Sun Java Studio Creator 2 – Online Help
 

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. For example, if you want the checkboxes laid out in a single row, set columns property to the number of checkboxes.

The items property is bound to an array, a list, or a collection p of com.sun.rave.web.ui.model.Option objects that populate the list. Right-click the component and choose Bind to Data to set this property. In the Outline window, 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.rave.web.ui.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
Binding Component Properties
Working With Components
Component Tasks: Quick Reference
Component Web Tutorials
Data Source Web Tutorials
About the Palette
Tutorials
Delving Into Components Tutorial
Using Virtual Forms
 
 
 
Legal Notices. Copyright © 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Close