UISelectItem Properties
UISelectItem Properties
this.shippingOption = shippingOption;
}
public String getShippingOption() {
return this.shippingOption;
}
Note that shippingOption represents the currently selected item from the list of items in the
UISelectOne
component.
As explained in the section
UISelectItem
and UISelectItems components are used to represent all the values in a
UISelectOne
component. See
and
for information on how to write the backing bean properties for the
UISelectItem
and UISelectItems components.
UISelectItem
Properties
A UISelectItem component represents one value in a set of values in a UISelectMany or
UISelectOne
component. The backing bean property that a UISelectItem component is
bound to must be of type SelectItem. A SelectItem object is composed of an Object
representing the value, along with two Strings representing the label and description of the
SelectItem
object.
The Duke's Bookstore application does not use any UISelectItem components whose values
are bound to backing beans. The example selectOneMenu tag from
contains selectItem tags that set the values of the list of
items in the page. Here is an example bean property that can set the values for this list in the
bean:
SelectItem itemOne = null;
SelectItem getItemOne(){
return itemOne;
}
void setItemOne(SelectItem item) {
itemOne = item;
}
UISelectItems
Properties
UISelectItems
components are children of UISelectMany and UISelectOne components.
Each UISelectItems component is composed of either a set of SelectItem instances or a set of
SelectItemGroup
instances. As described in
SelectItemGroup
is composed of a set of SelectItem instances. This section describes how to
write the properties for selectItems tags containing SelectItem instances and for
selectItems
tags containing SelectItemGroup instances.
Writing Bean Properties
Chapter 12 · Developing with JavaServer Faces Technology
385