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
acl5acl5 

Trouble binding MAP to VF dataTable

I am having an issue displaying the values stored in a MAP on my VF page. 

 

This code properly displayes the entire map:

 

<apex:dataTable value="{!amountsKeys}" var="a">    <apex:column >       <apex:outputText value="{!amountsMap}" >            </apex:outputText>    </apex:column>

 

Based on the documentation I read this code should display the value stored with key 'a" but instead I get an error message: Error: Syntax error.found 'amountsMap'

 

<apex:dataTable value="{!amountsKeys}" var="a"> 
   <apex:column >  
     <apex:outputText value="{!amountsMap[a]}" >
      
     </apex:outputText>
   </apex:column>

 

The map is defined appropirately in the controller and the getAmountsKeys method is returning the a key set by using the Map.keySet() method.

 

Any help would be greatly appreciated.

 

Adam

 

Best Answer chosen by Admin (Salesforce Developers) 
acl5acl5

UUGGHH!  Tried changin the dataTable to repeat to more closely resemble the example in the documentation and realized my page was set to an API version before this syntax was supported.  Update the version and now the page works as expected.