ICEfaces
  1. ICEfaces
  2. ICE-8924

The GMap Autocomplete example only works when selecting from the list

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: EE-3.2.0.GA
    • Fix Version/s: 3.3
    • Component/s: ACE-Components, Sample Apps
    • Labels:
      None
    • Environment:
      ACE
    • Assignee Priority:
      P3

      Description

      While testing the portlet version of showcase, I noticed that the GMap Autocomplete example only seems to work properly if a value is selected from the drop down list. If I simply type a valid location (e.g. Paris) and hit Enter, nothing happens.

      In the non-portlet version this doesn't result in any errors but in the portlet version, it causes the following exception due to the fact that the URL for the output link is null or blank:


      19:36:16,909 ERROR [BaseURLEncodedStringImpl:57] URL path must start with a / or include ://
      java.lang.IllegalArgumentException: URL path must start with a '/' or include '://'
      at com.liferay.portlet.PortletResponseImpl.encodeURL(PortletResponseImpl.java:399)
      at com.liferay.faces.bridge.context.url.BaseURLEncodedStringImpl.toString(BaseURLEncodedStringImpl.java:54)
      at com.liferay.faces.bridge.context.url.BridgeURLBaseImpl.toString(BridgeURLBaseImpl.java:139)
      at com.liferay.faces.bridge.context.ExternalContextImpl.encodeResourceURL(ExternalContextImpl.java:134)
      at com.sun.faces.renderkit.html_basic.OutputLinkRenderer.renderAsActive(OutputLinkRenderer.java:239)
      at com.sun.faces.renderkit.html_basic.OutputLinkRenderer.encodeBegin(OutputLinkRenderer.java:107)
      ...

      This may be a problem with the bridge being a little overzealous in checking the link and not taking into consideration that it could be null but the current behaviour of the component or the example could probably be improved.

        Activity

        Deryk Sinotte created issue -
        Ken Fyten made changes -
        Field Original Value New Value
        Assignee Arturo Zambrano [ artzambrano ]
        Ken Fyten made changes -
        Assignee Priority P3 [ 10012 ]
        Hide
        Deryk Sinotte added a comment -

        GMap Autocomplete is now throwing a client-side error during the initial render which can interfere with other portlets/components.

        TypeError: 'undefined' is not an object (evaluating 'new google.maps.places.Autocomplete')

        Goes away if the "&libraries=places" is added to the GMap API key. Perhaps we should consider making this permanent. When it fails, Drag and Drop stops working but it works if the GMap Autocomplete portlet is removed. It also works if it's rendered "before" the GMap portlet rather than after. Still throws the following with LiferayFaces Bridge:

        Show
        Deryk Sinotte added a comment - GMap Autocomplete is now throwing a client-side error during the initial render which can interfere with other portlets/components. TypeError: 'undefined' is not an object (evaluating 'new google.maps.places.Autocomplete') Goes away if the "&libraries=places" is added to the GMap API key. Perhaps we should consider making this permanent. When it fails, Drag and Drop stops working but it works if the GMap Autocomplete portlet is removed. It also works if it's rendered "before" the GMap portlet rather than after. Still throws the following with LiferayFaces Bridge:
        Hide
        Arturo Zambrano added a comment -

        Committed multiple fixes to trunk at revision 33970. The changes were actually made using the JIRA ICE-8943.

        This is a list of all the fixes: rendered 'address' value in input field instead of keeping it hidden; do not hard-code client id of autocomplete input field in the renderer and javsscript code; appended places library to gmap api resources URL to save the developer from doing so in web.xml; improved tlddoc explanation of some properties; set default value of 'link' property to avoid issues in portlets; made component work when pressing enter and not just when selecting a value from the list; avoided double submission when pressing enter.

        Show
        Arturo Zambrano added a comment - Committed multiple fixes to trunk at revision 33970. The changes were actually made using the JIRA ICE-8943 . This is a list of all the fixes: rendered 'address' value in input field instead of keeping it hidden; do not hard-code client id of autocomplete input field in the renderer and javsscript code; appended places library to gmap api resources URL to save the developer from doing so in web.xml; improved tlddoc explanation of some properties; set default value of 'link' property to avoid issues in portlets; made component work when pressing enter and not just when selecting a value from the list; avoided double submission when pressing enter.
        Arturo Zambrano made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #34083 Tue Mar 26 15:46:55 MDT 2013 art.zambrano ICE-8924 added default url in demo to avoid error message in portlet environments
        Files Changed
        Commit graph MODIFY /icefaces3/trunk/icefaces/samples/showcase/showcase/src/main/java/org/icefaces/samples/showcase/example/ace/gMap/MapAutocompleteBean.java
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #34359 Thu Apr 11 15:24:36 MDT 2013 art.zambrano ICE-8924 fix for issue related to only being able to use once the autocomplete functionality: removed the client id from text input to cause an update of the whole autocomplete component markup, from the root node, which includes the script tag that re-applies the autocomplete functionality to the text input
        Files Changed
        Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/src/org/icefaces/ace/component/gmap/GMapAutocompleteRenderer.java
        Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/resources/icefaces.ace/gmap/gmap.js
        Hide
        Arturo Zambrano added a comment -

        Committed another fix at revision 34359. The fix is for the issue related to only being able to use once the autocomplete functionality. The client id was removed from the text input to cause an update of the whole autocomplete component markup, from the root node, which includes the script tag that re-applies the autocomplete functionality to the text input.

        Show
        Arturo Zambrano added a comment - Committed another fix at revision 34359. The fix is for the issue related to only being able to use once the autocomplete functionality. The client id was removed from the text input to cause an update of the whole autocomplete component markup, from the root node, which includes the script tag that re-applies the autocomplete functionality to the text input.
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #34361 Thu Apr 11 16:04:39 MDT 2013 ken.fyten ICE-8924 fix for issue related to only being able to use once the autocomplete functionality: removed the client id from text input to cause an update of the whole autocomplete component markup, from the root node, which includes the script tag that re-applies the autocomplete functionality to the text input.
        Files Changed
        Commit graph MODIFY /icefaces3/tags/icefaces-3.3.0/icefaces/ace/component/src/org/icefaces/ace/component/gmap/GMapAutocompleteRenderer.java
        Commit graph MODIFY /icefaces3/tags/icefaces-3.3.0/icefaces/ace/component/resources/icefaces.ace/gmap/gmap.js
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #34385 Fri Apr 12 12:48:04 MDT 2013 art.zambrano ICE-8924 added styling to display autocomplete results aligned to the left
        Files Changed
        Commit graph MODIFY /icefaces3/trunk/icefaces/ace/component/resources/icefaces.ace/gmap/gMap.css
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #34390 Fri Apr 12 14:55:22 MDT 2013 ken.fyten ICE-8924 added styling to display autocomplete results aligned to the left.
        Files Changed
        Commit graph MODIFY /icefaces3/tags/icefaces-3.3.0/icefaces/ace/component/resources/icefaces.ace/gmap/gMap.css
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Arturo Zambrano
            Reporter:
            Deryk Sinotte
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: