Probably the cleanest solution would be to define an EL function that
converted your Lists into maps.

Creating EL expressions is still ugly under pure Myfaces, however.

On 9/8/05, Rick Reumann <[EMAIL PROTECTED]> wrote:
> What's the best way in JSF/MyFaces to use a List to create a select
> options list? I know the SelectItems can be built from a Map, but it
> doesn't seem to support a list of objects too well.  Can I at least
> set them easily looping over my collection manually?
> 
> For example in JSTL.. I can creat my options ...
> 
> <c:forEach items='${employees}' var='emp'>
>     <html:option value="${emp.empID}">${emp.name}</html:option>
> </c:forEach>
> 
> Can I do this with a dataList inbetween  <h:selectOneMenu > tags?
> 
> It would be cool if the selectItems tag supported:
> 
> <f:selectItems collection="#{employees}" label="${name} value="${empID}" />
> 
> (above would loop over your collection of employees pull out Employee
> and call appropriate getters - getName getEmpID )
> 
> --
> Rick
>

Reply via email to