Theme
TriStateManyCheckbox
Basic Usage:
Ajax Behavior with custom icons:
Selected Values
  • Cat state = 1
  • Tamara state = 1
  • Mauricio state = 1
Source
<!-- This group is for coding -->
<p:growl id="growl" showDetail="true"/>
<h:panelGrid id="triStateGrid" columns="2" style="margin-bottom:10px" cellpadding="5">

    <h:outputText value="Basic Usage:"/>
    <pe:triStateManyCheckbox id="TriBasic"
                             value="#{triSateManyCheckBoxController.selectedOptionsTriStateBasic}"
                             layout="pageDirection"
                             stateOneTitle="not matter"
                             stateTwoTitle="love it"
                             stateThreeTitle="dislikes">
        <f:selectItems value="#{triSateManyCheckBoxController.basicOptions}"/>
    </pe:triStateManyCheckbox>

    <h:outputText value="Ajax Behavior with custom icons:"/>
    <pe:triStateManyCheckbox id="TriAjax"
                             value="#{triSateManyCheckBoxController.selectedOptionsTriStateAjax}"
                             stateOneIcon="ui-icon-home"
                             stateTwoIcon="ui-icon-heart"
                             stateThreeIcon="ui-icon-star"
                             tabindex="2">
        <f:selectItem itemLabel="Tamara" itemValue="Tamara"/>
        <f:selectItem itemLabel="Mauricio" itemValue="Mauricio"/>
        <p:ajax event="change" update="growl" listener="#{triSateManyCheckBoxController.addMessage}"/>
    </pe:triStateManyCheckbox>
</h:panelGrid>

<p:commandButton value="Submit" update="display" oncomplete="PF('dlg').show()"/>

<p:dialog header="Selected Values" modal="false" showEffect="fade" hideEffect="fade" widgetVar="dlg" width="200">
    <p:outputPanel id="display">
        <p:dataList value="#{triSateManyCheckBoxController.selectedOptionsTriStateBasic.keySet().toArray()}"
                    var="optionsB">
            #{optionsB} state = #{triSateManyCheckBoxController.selectedOptionsTriStateBasic.get(optionsB)}
        </p:dataList>

        <p:dataList value="#{triSateManyCheckBoxController.selectedOptionsTriStateAjax.keySet().toArray()}"
                    var="optionsA">
            #{optionsA} state = #{triSateManyCheckBoxController.selectedOptionsTriStateAjax.get(optionsA)}
        </p:dataList>
    </p:outputPanel>
</p:dialog>
            
Components and more
Documentation pe:triStateManyCheckbox
Attributes (move mouse over the names to see data types)
Name Description
id Unique identifier of the component in a namingContainer.
rendered Boolean value to specify the rendering of the component, when set to false component will not be rendered.
binding An EL expression referring to a server side UIComponent instance in a backing bean.
value Value of the component.
converter An EL expression or a literal text that defines a converter for the component. When it's an EL expression, it's resolved to a converter instance. In case it's a static text, it must refer to a converter id.
immediate When set true, process validations logic is executed at apply request values phase for this component. Default is false.
required Marks component as required.
validator A method expression referring to a method validationg the input.
valueChangeListener A method binding expression referring to a method for handling a valuchangeevent.
requiredMessage Message to display when required field validation fails.
converterMessage Message to display when conversion fails.
validatorMessage Message to display when validation fails.
widgetVar Name of the client side widget.
disabled Disable the component.
label User presentable name.
layout Layout of the checkboxes, valid values are �lineDirection�(horizontal) and �pageDirection�(vertical).
onchange Callback on change event.
style Inline style of the component.
styleClass Style class of the main Layout container element. Default value is null.
stateOneIcon Icon for StateOne as a css class.
stateTwoIcon Icon for StateTwo as a css class.
stateThreeIcon Icon for StateThree as a css class.
stateOneTitle Title for StateOne.
stateTwoTitle Title for StateTwo.
stateThreeTitle Title for StateThree.
tabindex The tab index to assign to the component, If not given, tabindex=0 will be assigned.
PrimeFaces Extensions Showcase - © 2011-2018, PrimeFaces: 6.2, PrimeFaces Extensions: 6.2.4, JSF: mojarra 2.3.2, Server: jetty/9.4.2.v20170220, Build time: 2018-04-10 14:26
occured!
Message:
Timestamp:
StackTrace:
Developers
Thomas Andraschko andraschko.thomas@gmail.com
Oleg Varaksin ovaraksin@googlemail.com
Nilesh Namdeo Mali nileshmali86@gmail.com
Mauricio Fenoglio fenoglio.mauricio@gmail.com
Pavol Slaný pavol.slany@gmail.com
Sudheer Jonna sudheer.jonna@gmail.com