You need to sign in to do that
Don't have an account?
Christian Dylan Carter
Nested <apex:repeat> within an <apex:map>
I'm running into some odd errors with a nested apex:repeat inside of an apex:map (on API 34.0). My code looks like this:
This results in an odd error:
Result: [COMPILE FAILED]: (ReferralMap) <apex:outputPanel> cannot be used inside <apex:map> in the markup (Line: 1, Column: -1)
If I remove the outputPanel I get a message saying that outputField is not acceptable. If I remove that and just use an expression, that also fails.
As soon as I remove the second apex:repeat and hard code fields instead of a FieldSet, the errors go away and I can have an outputPanel in the map. That said, I'd much rather have a FieldSet!
Any ideas?
Later on in the page, I use this pattern very successfully, it only fails inside the <apex:map>:
<apex:map width="500px" height="500px" center="53704"> <apex:repeat value="{!matches}" var="match"> <apex:mapMarker title="{!match.Provider__r.Name}" position="{latitude:{!match.Provider__r.Latitude_Display__c},longitude:{!match.Provider__r.Longitude_Display__c}}"> <apex:mapInfoWindow> <apex:repeat value="{!$ObjectType.Account.FieldSets.Provider_Detail_Pin}" var="f"> <apex:outputPanel layout="block" style="font-weight: bold;"> <apex:outputField value="{! match.Provider__r[f] }"/> </apex:outputPanel> </apex:repeat> </apex:mapInfoWindow> </apex:mapMarker> </apex:repeat> </apex:map>
This results in an odd error:
Result: [COMPILE FAILED]: (ReferralMap) <apex:outputPanel> cannot be used inside <apex:map> in the markup (Line: 1, Column: -1)
If I remove the outputPanel I get a message saying that outputField is not acceptable. If I remove that and just use an expression, that also fails.
As soon as I remove the second apex:repeat and hard code fields instead of a FieldSet, the errors go away and I can have an outputPanel in the map. That said, I'd much rather have a FieldSet!
Any ideas?
Later on in the page, I use this pattern very successfully, it only fails inside the <apex:map>:
<apex:repeat value="{!providersMatchingSome}" var="match"> <apex:pageBlockSection title="{!match.Provider__r.Name}"> <apex:repeat value="{!$ObjectType.Account.FieldSets.Provider_Detail_Block}" var="f"> <apex:outputField value="{!match.Provider__r[f]}" /><br/> </apex:repeat> </apex:pageBlockSection> </apex:repeat>
Can you please post your full Controller code here?
Thank You,
Hitesh Patel
Email :- hiteshpatel.aspl@gmail.com
Mo. +91 7843045098
http://mrjavascript.blogspot.in/
I am using a small controller extension to filter a relationship, but I have just tested and confirmed that the issue comes up even with just the standard controller and no additional apex.
Thanks,
Please find below sample code for your map requirement.
Visualforce Page:
Apex Class:
Thank You,
Hitesh Patel
Email :- hiteshpatel.aspl@gmail.com
http://mrjavascript.blogspot.in/
Taht works! Thanks. Do you know why there's an error in nested repats within a map? Is this a platform bug, or a limit?
Yes Carter,
This is the syntax of using "<apex:mapInfoWindow>" tag in visualforce page. this is not a limitation or bug. we can't user <apex:repeat> inside this tag.
Thank You,
Hitesh Patel
Email :- hiteshpatel.aspl@gmail.com
http://mrjavascript.blogspot.in/