Sun Java Studio Creator 2 – Online Help
 

Listbox Component

See Also | Tutorials

You can drag the Listbox component listbox icon from the Palette's Basic category to the Visual Designer to create a component that enables the user to select items from a list of items. If the box is too small to contain the items in the list, the list box includes scrollbars.

By default, only one item can be selected in the list. The multiple property determines whether one item or multiple items can be selected by the user.

You can set the items property to associate the component either with a database table or with an array, a collection, or a map of com.sun.rave.web.ui.model.Option objects to 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 listbox1DefaultOptions.

You set the selected property to associate the component with a model object that picks up the list 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.

After adding a Listbox Component to a page, 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 Listbox Components
 
 
 
Legal Notices. Copyright © 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Close