Tobago Demo

Menu

Multi Checkbox

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: <tc:selectManyCheckbox/> | <tc:selectItem/> | <tc:selectItems/>

Basics

Checkbox Group with two items. The second one is disabled.

<tc:selectManyCheckbox label="Checkbox Group">

Inline

To display the radio buttons horizontally use the inline="true" attribute.

Images

Simple Usage

Select an animal. The selection is shown in the output field, 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.

Ajax

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 output field after check/uncheck a checkbox.

0

Free layout with <tc:selectReference>

Attanion! The <tc:selectReference> currently works only, when the referenced component <tc:selectManyCheckbox> has set labelLayout="skip".

First and second giant planets:
Discovered 1781:
Discovered 1846:
Selected:

Free layout with group attribute (JSF HTML tags - since JSF 2.3)

Attention! This example is only temporary for testing purpose. Does not currently work with Mojarra or MyFaces, but for different reasons.

© 2005-2023 Apache Software Foundation, Licensed under the Apache License, Version 2.0.