myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Behrang Saeedzadeh" <>
Subject Binding a java.util.List to a selectOneMenu
Date Mon, 27 Nov 2006 11:40:44 GMT

In a backing bean I have a set/get property called humanResources that
returns a java.util.List containing HumanResource instances. The
HumanResource class contains a few properties, three of them being
firstName, lastName, and userName.

I want to bind the humanResources list to a h:selectOneMenu component,
and I want each option of the menu to look like

  #{humRsrc.lastName}, #{humRsrc.firstName} (#{humRsrc.username})

Is it possible to assign the java.util.List to the h:selectOneMenu
component directly, without creating SelectItems in the backing bean?

Thanks in advance,

"Science is a differential equation. Religion is a boundary condition"
- Alan Turing

Behrang Saeedzadeh

View raw message