Time for action – using the SelectOneButton component
Let us see how to use the <p:selectOneButton>
component, by performing the following step:
- Create a form with the
<p:selectOneButton>
component with multiple options:<h:form> <p:panel header="SelectOneButton"> <h:panelGrid style="margin-bottom:5px" cellpadding="3"> <p:selectOneButton value="#{selectionController.number}"> <f:selectItem itemLabel="One" itemValue="1"/> <f:selectItem itemLabel="Two" itemValue="2"/> <f:selectItem itemLabel="Three" itemValue="3"/> </p:selectOneButton> </h:panelGrid> <p:commandButton value="Submit" update="display"/> <h:outputText id="display" value=" Value : #{selectionController.number}" /> </p:panel...