With <tc:selectManyCheckbox/>
, you can create a group of checkboxes.
The items are added via <tc:selectItem/>
for static entries or
<tc:selectItems value="\#{controller.list}"/>
for entries from a
controller.
Tag Library Documentation:
Checkbox Group with two items. The second one is disabled.
<tc:selectManyCheckbox label="Checkbox Group">
To display the radio buttons horizontally use the inline="true"
attribute.
Select an animal. The selection is shown in the outputfield, after pressing 'Submit'.
<tc:selectManyCheckbox label="Checkbox Group" value="\#{selectManyCheckboxController.animals}">
save the selected value in the controller.
The available items are added with <tc:selectItem .../>
.
The
<tc:out ... value="\#{selectManyCheckboxController.animal}"/>
get the value from the controller.
Select a number. Those numbers are added and displayed in the
<tc:out id="resultOutput" .../>
.
<tc:selectManyCheckbox .../>
contain a
<f:ajax render="resultOutput"/>
, which rerenders the outputfield after
check/uncheck a checkbox.