html
Tag options


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:optionsCollection> elements.

This tag operates in one of two major modes, depending on whether or not the collection attribute is specified. If the collection attribute is included, the following rules apply:

If the collection attribute is not specified, the rules described in the remainder of this section apply.

The collection of values actually selected depends on the presence or absence of the name and property attributes. The following combinations are allowed:

The collection of labels displayed to the user can be the same as the option values themselves, or can be different, depending on the presence or absence of the labelName and labelProperty attributes. If this feature is used, the collection of labels must contain the same number of elements as the corresponding collection of values. The following combinations are allowed:

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.



Tag Information
Tag Classorg.apache.struts.taglib.html.OptionsTag
TagExtraInfo ClassNone
Body Contentempty
Display NameNone

Attributes
NameRequiredRequest-timeTypeDescription
collectionfalsetruejava.lang.StringName of the JSP bean (in some scope) which is itself a Collection of other beans, each of which has properties named by the "property" and "labelProperty" attributes that are used to retrieve the value and label for each option, respectively.
filterfalsetruebooleanSet to false if you do NOT want the option labels filtered for sensitive characters in HTML. By default, such values are filtered.
labelNamefalsetruejava.lang.StringName of the JSP bean (in some scope) containing the collection of labels to be displayed to the user for these options.
labelPropertyfalsetruejava.lang.StringProperty of the form bean, or the bean specified by the labelName attribute, that will return the collection of labels to be displayed to the user for these options.
namefalsetruejava.lang.StringName of the JSP bean (in some scope) containing the collection of values to be returned to the server for these options. If not specified, the form bean associated with our form is assumed.
propertyfalsetruejava.lang.StringProperty of the form bean, or the bean specified by the name attribute, that will return the collection of values to returned to the server for these options.
stylefalsetruejava.lang.StringCSS styles to be applied to this HTML element.
styleClassfalsetruejava.lang.StringCSS stylesheet class to be applied to this HTML element (renders a "class" attribute).

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.