• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Error when using Map.values() in dataTable

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 >
<h:outputText 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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic