f
Tag selectItems


Add a child UISelectItems component to the UIComponent associated with the closed parent UIComponent custom action.

When iterating over the select items, toString() mest be called on the string rendered attribute values.

Version 2 of the specification introduces several new attributes, described below. These are: var, itemValue, itemLabel, itemDescription, itemDisabled, and itemLabelEscaped.



Tag Information
Tag Classcom.sun.faces.taglib.jsf_core.SelectItemsTag
TagExtraInfo ClassNone
Body Contentempty
Display NameNone

Attributes
NameRequiredRequest-timeTypeDescription
bindingfalsefalsejavax.el.ValueExpression
(must evaluate to javax.faces.component.UIComponent)
Value binding expression to a backing bean property bound to the component instance for the UIComponent created by this custom action.
idfalsetruejava.lang.StringComponent identifier of the UISelectItems component to be created.
valuefalsefalsejavax.el.ValueExpression
(must evaluate to java.lang.Object)

Value expression pointing at any Collection or array. The member elements may be instances of SelectItem or any Java Object. In the case where the member elements are plain Java Objects, several additional attributes must be used by the page author to correctly identify the data to the enclosing UISelectOne or UISelectMany component, as shown in the following example.

  1. <h:selectOneListbox size="1" id="escape02" value="#{select05NoSelection.initialCollectionValues}">
  2.   <f:selectItems value="#{select05NoSelection.hobbitList}"
  3.                  var="n"
  4.                  itemValue="#{n}"
  5.                  itemLabel="#{n.bio}"
  6.                  itemDescription="#{n.description}"
  7.                  itemDisabled="#{n.disabled}"
  8.                  itemLabelEscaped="true"
  9.                  noSelectionValue="#{select05NoSelection.hobbitList[0]}"/>
  10. </h:selectOneListbox>

In the preceding example, the value attribute on line 1 points to a Collection<HobbitBean>. HobbitBean is just a regular Java Object (POJO) that conforms to JavaBeans naming conventions for its properties. The value attribute on line 2 points to a List<HobbitBean>, though it could just as well point to a Collection, array, or javax.faces.model.DataModel. The attributes on lines 3 through 9, inclusive, leverage the fact that the value is a collection of POJOs.

varfalsefalsejava.lang.String

Expose the value from the value attribute under this request scoped key so that it may be referred to in EL for the value of other attributes.

itemValuefalsefalsejavax.el.ValueExpression
(must evaluate to java.lang.Object)

evaluates to a Collection, array, or Map from which the items to be shown will be rendered.

itemLabelfalsefalsejavax.el.ValueExpression
(must evaluate to java.lang.String)

evaluates to a String that will serve as the label to be shown for the item.

itemDescriptionfalsefalsejavax.el.ValueExpression
(must evaluate to java.lang.String)

evaluates to a String that will serve as the description to be shown for the item.

itemDisabledfalsefalsejavax.el.ValueExpression
(must evaluate to java.lang.Boolean)

evaluates to a boolean that will determine if the item value is selectable or not.

itemLabelEscapedfalsefalsejavax.el.ValueExpression
(must evaluate to java.lang.Boolean)

evaluates to a boolean that will determine if the rendered markup for the item receives normal JSF HTML escaping or not.

itemLabelEscapedfalsefalsejavax.el.ValueExpression
(must evaluate to java.lang.Boolean)

Is either an EL expression pointing to the element in the value collection whose value should be marked as a “no selection” item, or a literal string that exactly matches the value of the item in the collection that must be marked as the “no selection” item. If the user selects such an item and the field is marked as required, then it will not pass validation.


Variables
No Variables Defined.


Output Generated by Tag Library Documentation Generator. Java, JSP, and JavaServer Pages are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries. Copyright 2002-4 Sun Microsystems, Inc. 4150 Network Circle Santa Clara, CA 95054, U.S.A. All Rights Reserved.