SelectManyButton

SelectManyButton is an input component to select options using buttons instead of checkboxes.

B
I
U

Selected Values

    Source

    <h:form>
    
        <p:selectManyButton value="#{formBean.selectedOptions}">
            <f:selectItem itemLabel="B" itemValue="Bold" />
            <f:selectItem itemLabel="I" itemValue="Italic" />
            <f:selectItem itemLabel="U" itemValue="Underline" />
        </p:selectManyButton>
    
        <p:separator style="margin-bottom:20px"/>
    
        <p:commandButton value="Submit" oncomplete="dlg.show()" update="display" />
    
        <p:dialog header="Selected Values" modal="true" showEffect="fade" hideEffect="fade" widgetVar="dlg">
            <p:dataList id="display" value="#{formBean.selectedOptions}" var="option">
                #{option}
            </p:dataList>
        </p:dialog>
    
    </h:form>