myfaces-users mailing list archives

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

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,
Behi

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

Behrang Saeedzadeh
http://www.jroller.com/page/behrangsa
http://my.opera.com/behrangsa

Mime
View raw message