optionsCollection - Render a Collection of Select Options

Renders a set of HTML <option> elements, representing possible choices for a <select> element. This tag can be used multiple times within a single <html:select> element, either in conjunction with or instead of one or more <html:option> or <html:options> elements.

This tag operates on a collection of beans, where each bean has a label property and a value property. The actual names of these properties can be configured using the label and value attributes of this tag.

This tag differs from the <html:options> tag in that it makes more consistent use of the name and property attributes, and allows the collection to be more easily obtained from the enclosing form bean.

Note that this tag does not support a styleId attribute, as it would have to apply the value to all the option elements created by this element, which would mean that more than one id element might have the same value, which the HTML specification says is illegal.

Attribute Name Description
filter Set to false if you do NOT want the option labels filtered for sensitive characters in HTML. By default, such values are filtered. [RT Expr]
label The property of the bean within the collection which represents the label to be rendered for each option. Defaults to "label". [RT Expr]
name The attribute name of the bean whose properties are consulted when rendering the current value of this input field. If not specified, the bean associated with the form tag we are nested within is utilized. [RT Expr]
property The property of the form bean, or the bean specified by the name attribute, that will return the collection of objects to be rendered for these options. [RT Expr]
style CSS styles to be applied to this HTML element. [RT Expr]
styleClass CSS stylesheet class to be applied to this HTML element (renders a "class" attribute). [RT Expr]
value The property of the bean within the collection which represents the value to be rendered for each option. Defaults to "value". [RT Expr]