Creating drop-down lists using SelectOneMenu
The SelectOneMenu component is an extended version of the standard SelectOneMenu component with theme integration. We can create a basic drop-down list using <p:selectOneMenu>
as follows:
<p:selectOneMenu value="#{selectionController.number}"> <f:selectItem itemLabel="Select One" itemValue="" /> <f:selectItem itemLabel="One" itemValue="1" /> <f:selectItem itemLabel="Two" itemValue="2" /> <f:selectItem itemLabel="Three" itemValue="3" /> </p:selectOneMenu>
The <p:selectOneMenu>
component provides the following attributes to customize it's behavior:
effect
: Name of the toggle animation. Default value isfade
. Available effect options areblind
,bounce
,clip
,drop
,explode
,fold
,highlight
,puff
,pulsate
,scale
,shake
,size
,slide
, andnone
.effectSpeed
: Duration of toggle animation in milliseconds...