JSF 1.2 Checkbox Group Component

See Also | Tutorials

You can drag the Checkbox Group component checkbox list icon from the Palette's Basic category to the Visual Designer to create a table of labeled checkboxes.

The checkboxes are rendered in rows and columns in an HTML <table> element. The number of rows is defined by the number of checkboxes. The number of columns is defined by the columns property. The default layout is a single vertical column. If you want the checkboxes laid out in a single row, you can set the columns property to the number of checkboxes.

The items property is bound to an array, a list, or a collection of com.sun.webui.jsf.model.Option objects that populate the list. Right-click the component and choose Bind to Data to set this property. In the   you can see the default object that populates the list, which has a name similar to checkboxGroup1DefaultOptions. The option labels become the checkbox labels. When the user selects one or more checkboxes, the component's selected property contains an array of the selected values.

You set the selected property to associate the component with a model object that picks up the items selected by the user. The model object must be an array of objects whose values represent the values of the com.sun.webui.jsf.model.Option objects in the list. The first time the component is rendered, the options that correspond to the value of the selected property, if there are any, are marked as selected.

For information on binding the component to an object to set up the list, see Bind to Data below.

After dragging the component to the Visual Designer, you can do a number of things with it:

See Also
Checkbox Group Properties Window
Binding Component Properties
Working With Components
Component Tasks: Quick Reference
About the Visual Web Palette
Tutorials

Legal Notices