Stripes Tag Library
Tag option


Generates an <option value="foo">Fooey</option> HTML tag. Coordinates with an enclosing select tag to determine its state (i.e. whether or not it is selected.) As a result some of the logic regarding state repopulation is a bit complex.

Since options can have only a single value per option the value attribute of the tag must be a scalar, which will be converted into a String using a Formatter if an appropriate one can be found, otherwise the toString() method will be invoked.The presence of a "selected" attribute is used as an indication that this option believes it should be selected by default - the value (as opposed to the presence) of the selected attribute is never used....

The option tag delegates to its enclosing select tag to determine whether or not it should be selected. See the stripes:select for documentation on how it determines selection status. If the select tag has no opinion on selection state (note that this is not the same as select tag deeming the option should not be selected) then the presence of the selected attribute (or lack thereof) is used to turn selection on or off.

If the option has a body then the String value of that body will be used to generate the body of the generated HTML option. If the body is empty or not present then the label attribute will be written into the body of the tag.

If the label attribute's value is used, it will be HTML-encoded before being written out. However, the tag body, if present, will not be HTML-encoded. This allows the explicit use of HTML character entities within the tag, which would be impossible otherwise. If you choose to set the tag body and you want the output to be HTML-encoded, you must use something like the escapeXml attribute of the <c:out> tag to HTML-encode the value before passing it to <stripes:option>.



Tag Information
Tag Classnet.sourceforge.stripes.tag.InputOptionTag
TagExtraInfo ClassNone
Body ContentJSP
Display Nameoption

Attributes
NameRequiredRequest-timeTypeDescription
valuefalsetruejava.lang.Object The value that will be submitted to the server if this option is selected. Will be rendered as a String using the Stripes Formatting service, which will apply a formatter if an applicable one is found, or call toString() if one is not.
labelfalsetruejava.lang.StringA value to use as the body of the generated HTML label tag.
selectedfalsetruejava.lang.String If present, and the parent select tag had no value= attribute, causes the option to be selected by default. The value is ignored, only presence in meaningful.
disabledfalsetruejava.lang.StringDisables the input element when it first loads so that the user can not write text in it, or select it. (HTML Pass-through)
formatTypefalsetruejava.lang.StringThe type used to format the object. If the value is a date, valid values are 'date', 'time' and 'datetime'. If the value is a Number, valid values are 'number', 'percentage' and 'currency'.
formatPatternfalsetruejava.lang.StringThe pattern to apply. Can be either a named pattern or an actual pattern as understood by java.text.DateFormat or java.text.NumberFormat as appropriate for the type of object being formatted.
accesskeyfalsetruejava.lang.StringKeyboard shortcut to access the element. (HTML Pass-through)
classfalsetruejava.lang.StringThe CSS class to be applied to the element. (HTML Pass-through)
dirfalsetruejava.lang.StringText direction. (HTML Pass-through)
idfalsetruejava.lang.StringA unique identifier for the HTML tag on the page. (HTML Pass-through)
langfalsetruejava.lang.StringThe language code of the element. (HTML Pass-through)
onblurfalsetruejava.lang.StringScripting code run when the element loses focus. (HTML Pass-through)
onchangefalsetruejava.lang.StringScripting code run when the element changes. (HTML Pass-through)
onclickfalsetruejava.lang.StringScripting code run on each mouse click. (HTML Pass-through)
ondblclickfalsetruejava.lang.StringScripting code run on a double-click of the mouse. (HTML Pass-through)
onfocusfalsetruejava.lang.StringScripting code run when the element acquires focus. (HTML Pass-through)
onkeydownfalsetruejava.lang.StringScripting code run when a key is depressed. (HTML Pass-through)
onkeypressfalsetruejava.lang.StringScripting code run when a key is pressed and released. (HTML Pass-through)
onkeyupfalsetruejava.lang.StringScripting code run when a key is released. (HTML Pass-through)
onmousedownfalsetruejava.lang.StringScripting code run when a mouse button is depressed. (HTML Pass-through)
onmousemovefalsetruejava.lang.StringScripting code run when the mouse pointer is moved. (HTML Pass-through)
onmouseoutfalsetruejava.lang.StringScripting code run when the mouse pointer moves out of the element. (HTML Pass-through)
onmouseoverfalsetruejava.lang.StringScripting code run when the mouse pointer moves over the element. (HTML Pass-through)
onmouseupfalsetruejava.lang.StringScripting code run when a mouse button is released. (HTML Pass-through)
onselectfalsetruejava.lang.StringScripting code run when an element is selected. (HTML Pass-through)
stylefalsetruejava.lang.StringInline CSS style fragment that applies to the element (HTML Pass-through)
tabindexfalsetruejava.lang.StringThe tab order of the element. (HTML Pass-through)
titlefalsetruejava.lang.StringTool-tip text for the element. (HTML Pass-through)

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.