EL and maps
I have a managed bean containing a list of maps. My page contains a datatable which iterates over this list. The key into each map is stored in a property in the managed bean. I want to use this property to key into the map, and then access a property in the resulting object.
Let's call my managed bean myBean.
This contains a String property called myKey, and a property myData, of type ArrayList< HashMap<String, MyObj> >
MyObj contains a property myProp.
I want to iterate over the list of hashmaps, and use the myKey property to get the correct MyObj object from the map, then get the myProp property from the MyObj object.
My page contains a datatable as follows:
<h:dataTable
value="#{myBean.myData}
var="myMap"
>
<h:column>
<h:outputText value="#{myMap[myBean.myKey].myProp}" />
</h:column>
</h:dataTable>
This looks to me as if it should work, but it doesn't. I just get an empty datatable.
I'm no expert on this, so I wanted to know if it's actually possible to do what I'm trying to do, and if so, what is wrong with my EL expression?
Thanks in advance.
Stuart

