Developing Web 2.0 applications
with JavaServerFaces
and Dreamweaver
>> Just Became Easier
Documentation
Search
  1. Introduction
  2. Getting Started
  3. Developing Web Sites
  4. Using Components
  5. Internationalization
  6. Code View Support
  7. Design View Support
  8. Keyboard Shortcuts
  9. Tag Object Toolbars
  10. JSF Server Behaviors
  11. Property Inspectors
  12. JSF Tag Reference
JSF Core Tag Library
  f:actionListener
  f:ajax
  f:attribute
  f:convertDateTime
  f:convertNumber
  f:converter
  f:event
  f:facet
  f:loadBundle
  f:metadata
  f:param
  f:phaseListener
Selected f:selectItem
  f:selectItems
  f:setPropertyActionListener
  f:subview
  f:validateBean
  f:validateDoubleRange
  f:validateLength
  f:validateLongRange
  f:validateRegex
  f:validateRequired
  f:validator
  f:valueChangeListener
  f:verbatim
  f:view
  f:viewParam
If you like this documentation, please take a look at my book:

12. JSF Core Tag Reference

Documentation > JSF > JSF Tag Reference > JSF Core Tag Library > 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.

JSF Example

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" 
      xmlns:f="http://java.sun.com/jsf/core" 
      xmlns:h="http://java.sun.com/jsf/html">
<h:head />
<body>
<h:form>
	<h:selectOneMenu id="list1">
		<f:selectItem itemLabel="Option 1" itemValue="1" />
	</h:selectOneMenu>
</h:form>
</body>
</html>
This example was formatted by JSFToolbox for Dreamweaver.

Rendered Output

Rendered f:selectItem tag

HTML Output

<form>
  <select id="list1" name="list1" size="1">
    <option value="1">Option 1</option>
  </select>
</form>

Tag Attributes

binding Expression
 
The value-binding expression linking this component tag to a backing bean property.
escape Boolean
 
Flag indicating that characters that are sensitive in the value of the itemLabel attribute must be escaped. This flag is set to "true" by default.
escapeItem Text
 
Flag indicating that characters that are sensitive in the value of the itemLabel attribute must be escaped. This flag is set to "true" by default.
id Text
 
The unique identifier value for this component. The value must be unique within the closest naming container.
itemDescription Text
 
The itemDescription attribute sets the description of this option (for use in development tools).
itemDisabled Boolean
 
The itemDisabled attribute is a boolean flag indicating whether the option created by this component is disabled. The default value is false.
itemLabel Text
 
The itemLabel attribute sets the label to be displayed to the user for this option.
itemValue Text
 
The itemValue attribute sets the value to be sent to the server if this option is selected by the user.
noSelectionOption Text
 
Flag indicating whether the option created by this component represents the special "no selection" option. Expressions must evaluate to a boolean. Default value is false.
value Text
 
he value attribute takes a value-binding expression pointing at a SelectItem instance containing the information for this option.