function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
hanimihanimi 

Map key is not found

hi,

I am trying to display map values based on key in Visualforce page.

 

<apex:repeat value="{!ContractWrapperMap['Dental']}" var="c">
<apex:outputText value="{!c.Groupnum}"></apex:outputText>
</apex:repeat>

 

 

can anyone give solution.

 

Its urgent...

souvik9086souvik9086

Add those values from map based on key in a list in apex and then use that list in the apex:repeat.

 

If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.

Thanks

sandeep@Salesforcesandeep@Salesforce

1st Way : - 

<apex:repeat value="ListofKeys" var="c">
<apex:outputText value="{!ContractWrapperMap[c]}"></apex:outputText>
</apex:repeat>

 

Here in controller you can build ListofKeys so we you can use that here easily.

 

2nd Way :- 

<apex:repeat value="ContractWrapperMap" var="c">
<apex:outputText value="{!ContractWrapperMap[c]}"></apex:outputText>
</apex:repeat>

 

Here is no need of creating iist of Keys

crop1645crop1645

Sandeep -- I learned something!  I must have missed the ability of VF dynamic bindings to reference controller maps; now I see it in the doc under the section :

'Referencing Apex Maps and Lists'

 

Thank you