12. JSF Tag Reference
Contents > JSF Tag Reference > JSF Core Tags
10. JSF Core Tag Reference
Contents > JSF Core Tag Reference > f:selectItem
f:selectItem |
|
The SelectItem tag adds a child UISelectItem component to the component associated with the enclosing tag. In the HTML renderkit, this creates a single element. It can be used with any of the select tags in the JSF HTML tag library. The body content of this tag must be empty.
Example:
<h:selectOneMenu id="list1">
<f:selectItem itemLabel="Option 1" itemValue="1"></f:selectItem>
</h:selectOneMenu>
HTML Output
<select id="list1" name="list1" size="1">
<option value="1">Option 1</option>
</select>
|
Tag Attributes
| binding |
String |
| |
| The value-binding expression linking this component tag to a backing bean property. |
| id |
String |
| |
| The unique identifier value for this component. The value must be unique within the closest naming container. |
| itemDescription |
String |
| |
The itemDescription attribute sets the description of this option (for use in development tools). |
| itemDisabled |
String |
| |
| The itemDisabled attribute is a boolean flag indicating whether the option created by this component is disabled. The default value is false. |
| itemLabel |
String |
| |
| The itemLabel attribute sets the label to be displayed to the user for this option. |
| itemValue |
String |
| |
| The itemValue attribute sets the value to be sent to the server if this option is selected by the user. |
| value |
String |
| |
| he value attribute takes a value-binding expression pointing at a SelectItem instance containing the information for this option. |
|