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
HTML Output
<form>
<select id="list1" name="list1" size="1">
<option value="1">Option 1</option>
</select>
</form>
|