The Java EE 6 Tutorial, Volume I

SelectBoolean Properties

Backing bean properties that hold the SelectBoolean component’s data must be of boolean or Boolean type. The example selectBooleanCheckbox tag from the section Displaying Components for Selecting One Value binds a component to a property. The following example shows a tag that binds a component value to a boolean property:

<h:selectBooleanCheckbox title="#{bundle.receiveEmails}"
     value="#{custFormBean.receiveEmails}" >
<h:outputText value="#{bundle.receiveEmails}">

Here is an example property that can be bound to the component represented by the example tag:

    protected boolean receiveEmails = false;
    public void setReceiveEmails(boolean receiveEmails) {
        this.receiveEmails = receiveEmails;
    public boolean getReceiveEmails() {
        return receiveEmails;