views:

523

answers:

1

How can I write a drop down box in JSF?

+5  A: 
To select one option
<h:selectOneMenu id="list1">
<f:selectItem itemLabel="Option 1" itemValue="1"></f:selectItem>
</h:selectOneMenu>

To select multiple option
 <h:selectManyListbox id="list">
 <f:selectItems value="#{optionBean.optionList}"></f:selectItem>
 </h:selectManyListbox>
Warrior