| Author |
Question with selectOneMenu
|
Jesse Felter
Greenhorn
Joined: Aug 23, 2004
Posts: 17
|
|
I have a quick question, is there any easy way to append to the beginning of a select menu. Meaning I have a list that comes out of the bean of items, but at the top of the menu I want it to say ALL ITEMS. Is there an easy way to add the ALL ITEMS at the front of the list and have the value set to "all" code: <h:selectOneMenu rendered="#{userDataBean.user && !ReportDataBean.reportListEmpty}" value="#{ReportDataBean.item}" styleClass="optionValue"> <f:selectItems value="#{itemDataBean.itemList}"/> </h:selectOneMenu> so this makes a menu list of all the items out of the bean, however I want to avoid adding in the the ALL ITEMS option in the bean because its used by other applications that do not need it. Thanks for the help in advance
|
 |
Prakash Jebaraj
Greenhorn
Joined: Mar 14, 2005
Posts: 5
|
|
Hi Jesse, You can add f:selectItem before f:selectItems tag like the following <h:selectOneMenu rendered="#{userDataBean.user && !ReportDataBean.reportListEmpty}" value="#{ReportDataBean.item}" styleClass="optionValue"> <f:selectItem itemLabel="ALL ITEMS " itemValue="all" id="allItems"/> <f:selectItems value="#{itemDataBean.itemList}"/> </h:selectOneMenu> Prakash
|
 |
 |
|
|
subject: Question with selectOneMenu
|
|
|