C H A P T E R  16

List Box

The List Box component is a type of choice component that presents its list of choices in a list box. Multiple choices, if allowed, can be selected by the user.

Property Name

Description

Notes

Allow Multiple Choices

Determines whether the user is allowed to select multiple choices or not. Default setting is false.

 

Choices

An array of choices that can be selected by the user. Each choice provides a value and a label.

 

Initial Value

The value to which the visual component is initialized upon its instantiation. Note, this value will overwrite any value in the bound model field if one exists. If you want to set a value on a component without potentially overwriting the model field's value, avoid using this property and instead use the setValue(Object value,boolean overwrite) method with the overwrite parameter set to false. You may call this method from your code as needed (for example, from an event handler) or from the Post-initialization Code property of the component.

 

Model Field Binding

The model field to which the visual component is bound (where it stores/retrieves its value). The Model Reference property must be configured before this property can be configured.

Dependent on Model Reference

Model Reference

A reference to the model to which the visual component's bound model field belongs. This property must be configured before the Model Field Binding property can be configured.

 

Name

The name of the component instance.

Req

Null Choice Label

The text that is displayed as the component's choice when the field's value is null. Leaving this property empty (null) will prevent a null choice option from being presented to the user, thus forcing the user to select one of the choices from the list.

 

Visible

Controls whether the component will be displayed or not. Can also be set programmatically using the component's setVisible(boolean) method.