Introducing SelectOneListbox
The SelectOneListbox component is an extended version of the standard SelectOneListbox component with theme integration. Basic usage of <p:selectOneListbox>
is as follows:
<p:selectOneListbox value="#{selectionController.number}"> <f:selectItem itemLabel="One" itemValue="1" /> <f:selectItem itemLabel="Two" itemValue="2" /> <f:selectItem itemLabel="Three" itemValue="3" /> </p:selectOneListbox>
The preceding <p:selectOneListbox>
component will be rendered as shown in the following screenshot:
We can also use POJOs to populate <p:selectOneListbox>
options. Let us see how to populate SelectOneListbox using POJOs.