aspose file tools
The moose likes JSF and the fly likes Error when using Map.values() in dataTable Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » JSF
Reply Bookmark "Error when using Map.values() in dataTable" Watch "Error when using Map.values() in dataTable" New topic
Author

Error when using Map.values() in dataTable

Tom van den Berge
Greenhorn

Joined: Jul 18, 2007
Posts: 1
I'm trying to display a dataTable, for which the value attribute is a Collection, obtained by calling the values() method on a HashMap.

Although the resulting object is definitely a Collection type, and to my knowledge, should therefore be correctly rendered by JSF, it fails with the following message:

Error getting property 'myProp' from bean of type java.util.HashMap$Values

The dataTable is constructed like this:

<h:dataTable id="items"
value="#{myBean.items}"
var="item">
<h:column >
<hutputText value="#{item.myProp}"/>
</h:column>
</h:dataTable>


A workaround for this problem is in the bean to wrap the HashMap.values() collection in an ArrayList before returning it.

However, I'd rather have a properly working dataTable!


Has somebody else encountered this problem? I couldn't find anything.


Tom
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Error when using Map.values() in dataTable
 
Similar Threads
Array of Object in DataTable
Using of nested Datatables
Problem with submit()
Reference outer dataTable var in inner dataTable
Input row select on data table does not get called