JSF 1.1 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 Navigator 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 Visual Web JSF page, you can do a number of things with it:

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

Legal Notices