Details
-
Type: Improvement
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 3.3
-
Fix Version/s: EE-4.0.0.GA, EE-3.3.0.GA_P03, 4.1
-
Component/s: ACE-Components
-
Labels:None
-
Environment:Tomcat 7.0.55
-
Assignee Priority:P1
-
Workaround Exists:Yes
-
Workaround Description:Use c:forEach if you can. c:forEach will not work if the code populating the ace:gMapMarker components is in an f:event tag in the page. This is because all the f:events execute after c:forEach.
Description
Attempting to dynamically populate an ace:gMap component with ace:gMapMarker component does not work with ui:repeat:
<ace:gMap style="height:500px; width:675px;">
<ui:repeat value="#{realmBean.userLocations}" var="location">
<ace:gMapMarker longitude="#{location.location.geometry.coordinates[0]}" latitude="#{location.location.geometry.coordinates[1]}" options="title:'#{location.username}'"/>
</ui:repeat>
</ace:gMap>
The result is an error in the browser (Firefox):
TypeError: a is null
...b[r]+b.D);Sa(c,b[C]+b.I)}function Um(a){return new W(a[yb],a[Cc])};function Vm(a...
{main,places}.js (line 44, col 1838)
<ace:gMap style="height:500px; width:675px;">
<ui:repeat value="#{realmBean.userLocations}" var="location">
<ace:gMapMarker longitude="#{location.location.geometry.coordinates[0]}" latitude="#{location.location.geometry.coordinates[1]}" options="title:'#{location.username}'"/>
</ui:repeat>
</ace:gMap>
The result is an error in the browser (Firefox):
TypeError: a is null
...b[r]+b.D);Sa(c,b[C]+b.I)}function Um(a){return new W(a[yb],a[Cc])};function Vm(a...
{main,places}.js (line 44, col 1838)
43272: added support for ui:repeat to all gMap* subcomponents.
Testing notes: This will require regression testing as well as creating a new test for each gMap* subcomponent, where a bunch of subcomponents are added to the page using ui:repeat. For example, the markup for the gMapMarker test would look something like this:
The items in the gMapMarkerBean.markerItems collection would be simple POJOs that store some of the attributes of the gMap* subcomponent, in this case latitude and longitude. The tests pass if the subcomponents are successfully displayed/applied on the map.