html
Tag 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.
Tag Information |
Tag Class | org.apache.struts.taglib.html.OptionsCollectionTag |
TagExtraInfo Class | None |
Body Content | empty |
Display Name | None |
Attributes |
Name | Required | Request-time | Type | Description |
filter | false | true | boolean | Set to false if you do NOT want the option labels filtered for sensitive characters in HTML. By default, such values are filtered. |
label | false | true | java.lang.String | The property of the bean within the collection which represents the label to be rendered for each option. Defaults to "label". |
name | false | true | java.lang.String | 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. |
property | false | true | java.lang.String | 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. |
style | false | true | java.lang.String | CSS styles to be applied to this HTML element. |
styleClass | false | true | java.lang.String | CSS stylesheet class to be applied to this HTML element (renders a "class" attribute). |
value | false | true | java.lang.String | The property of the bean within the collection which represents the value to be rendered for each option. Defaults to "value". |
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.