You can drag the Standard JavaServer Faces Multi Select Listbox component
from
the Palette to the Visual Designer to create a listbox that enables
the user to select multiple items from a list of items.
A Multi Select Listbox is a composite component that has the following elements:
ArrayList
object and use that object to test what the user's choices
were.item1
,
item2
, item3
. After dragging the component to the Visual Designer, you can do a number of things with it:
Object
array that you have added to the session
bean as a property. You can use this session bean property
to evaluate what the user chose after the page is submitted.
For more information, see the value property description
below.id
attribute. In the page bean,
this property's value is the name of the HtmlSelectManyCheckbox
object. This component can have more than one value, which has implications about what type of value you can use.
multiSelectListbox
.getValue()
is an object array.One way to process the values chosen by the user
is to bind this component to an ArrayList
object and check the array values when the user submits
the page.
<head>
section that is to be applied to the labels for disabled
items in the list.<head>
section that is to be applied to the labels for enabled
items in the list.SelectItems
component used to initialize the option.validate
method so you can insert code to validate the value of the component.processValueChange
method so you can insert code that executes when the value of this component changes (for example, the user chose two list items and pressed Enter).common_timeoutSubmitForm(this.form, 'component-id');
. At runtime, this code causes the form to be automatically submitted if the user changes the component value. Once the form is submitted, conversion and validation occur on the server and any value change listener methods execute, and then the page is redisplayed.
A component configured to Auto-Submit on Change can use virtual forms to limit the input fields that are processed when the form is submitted. If the auto-submit component is defined to submit a virtual form, only the participants in that virtual form will be processed when the auto-submit occurs.