You need to sign in to do that
Don't have an account?
Visualforce Dynamic Binding with Custom Components
Hi All,
I am trying to access values of a map in my class on the VF page using Dynamic Binding.
{!mymap['firstname']}
This works fine but now if I try to pass this as an attribute in one of the custom VF components it throws an error:
<c:mycomp fname="{!mymap['firstname']}"/>
Error thrown: Unknown property 'MapValue.firstname'.
any thoughts?
It might be a bug of some sort. Try using an apex:variable, assign mymap['firstname'] to that variable, then use that variable in the custom component's attribute. Something like this:
I know there's a few bugs related to collections not working correctly in all cases, and this might be one of them. The variable technique should work.
All Answers
It might be a bug of some sort. Try using an apex:variable, assign mymap['firstname'] to that variable, then use that variable in the custom component's attribute. Something like this:
I know there's a few bugs related to collections not working correctly in all cases, and this might be one of them. The variable technique should work.
The workaround worked. Thank you.
May be this is an issue. One small fix for who's using this.