You need to sign in to do that
Don't have an account?
Filikin
nested repeat in apex:map
Hi,
I am trying to use a nested repeat in an apex:map, but as soon as I try I get an error "<apex:repeat> cannot be used inside <apex:map> in the markup.
Here is the page:
<apex:page Controller="TestMapController" >
<apex:map id="visitsMap" width="100%" height="800px" mapType="roadmap" center="Dublin, Ireland">
<apex:repeat value="{!Addresses}" var="address">
<apex:repeat value="{!Addresses}" var="subaddress">
<apex:mapMarker title="{!address}" position="{!address}">
</apex:mapMarker>
</apex:repeat>
</apex:repeat>
</apex:map>
</apex:page>
and the controller is:
public class TestMapController
{
public String[] getAddresses()
{
return new String[]{'120 Drumcondra Road, Dublin 9','3 Corbawn Court, Dublin 18','35 Cremore Cresent, Dublin 11'};
}
}
can anyone see what I am doing wrong?
I am trying to use a nested repeat in an apex:map, but as soon as I try I get an error "<apex:repeat> cannot be used inside <apex:map> in the markup.
Here is the page:
<apex:page Controller="TestMapController" >
<apex:map id="visitsMap" width="100%" height="800px" mapType="roadmap" center="Dublin, Ireland">
<apex:repeat value="{!Addresses}" var="address">
<apex:repeat value="{!Addresses}" var="subaddress">
<apex:mapMarker title="{!address}" position="{!address}">
</apex:mapMarker>
</apex:repeat>
</apex:repeat>
</apex:map>
</apex:page>
and the controller is:
public class TestMapController
{
public String[] getAddresses()
{
return new String[]{'120 Drumcondra Road, Dublin 9','3 Corbawn Court, Dublin 18','35 Cremore Cresent, Dublin 11'};
}
}
can anyone see what I am doing wrong?
All Answers
It is a pity the error message to so obtuse.