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
ptepptep 

Accessing Map values on Visualforce page without custom getters and setters

In this thread: http://boards.developerforce.com/t5/Visualforce-Development/Accessing-Map-values-on-Visualforce-page/td-p/65017

 

Doug Chasman said "We do plan to provide native page formula support for maps and also access to length/size on collections - stay tuned for when that will be released."

 

Does anyone know if this is possible now? That is, can you get/set map key entries without writing individual getters/setters for each one?

 

thanks,

-paul

Best Answer chosen by Admin (Salesforce Developers) 
ForceCoderForceCoder

You can get Map values in VF now.  See the VF Developer's guide: 

http://www.salesforce.com/us/developer/docs/pages/index_Left.htm#StartTopic=Content/pages_dynamic_vf_maps_lists.htm?SearchType=Stem

 

Be careful when getting values from the Map.  If a value doesn't exist for a key, instead of something like null being returned an error is generated.

All Answers

ForceCoderForceCoder

You can get Map values in VF now.  See the VF Developer's guide: 

http://www.salesforce.com/us/developer/docs/pages/index_Left.htm#StartTopic=Content/pages_dynamic_vf_maps_lists.htm?SearchType=Stem

 

Be careful when getting values from the Map.  If a value doesn't exist for a key, instead of something like null being returned an error is generated.

This was selected as the best answer
ptepptep

Great, this is how I thought it worked, but I wasn't sure because I was having some problems using map entries as form inputs.

 

Thanks for the tip also, I'm already initializing all the map entries that I'm calling to the empty string.