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>.
Attributes |
Name | Required | Request-time | Type | Description |
value | false | true | java.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.
|
label | false | true | java.lang.String | A value to use as the body of the generated HTML label tag. |
selected | false | true | java.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.
|
disabled | false | true | java.lang.String | Disables the input element when it first loads so that the user can not write text in it, or select it. (HTML Pass-through) |
formatType | false | true | java.lang.String | The 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'. |
formatPattern | false | true | java.lang.String | The 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. |
accesskey | false | true | java.lang.String | Keyboard shortcut to access the element. (HTML Pass-through) |
class | false | true | java.lang.String | The CSS class to be applied to the element. (HTML Pass-through) |
dir | false | true | java.lang.String | Text direction. (HTML Pass-through) |
id | false | true | java.lang.String | A unique identifier for the HTML tag on the page. (HTML Pass-through) |
lang | false | true | java.lang.String | The language code of the element. (HTML Pass-through) |
onblur | false | true | java.lang.String | Scripting code run when the element loses focus. (HTML Pass-through) |
onchange | false | true | java.lang.String | Scripting code run when the element changes. (HTML Pass-through) |
onclick | false | true | java.lang.String | Scripting code run on each mouse click. (HTML Pass-through) |
ondblclick | false | true | java.lang.String | Scripting code run on a double-click of the mouse. (HTML Pass-through) |
onfocus | false | true | java.lang.String | Scripting code run when the element acquires focus. (HTML Pass-through) |
onkeydown | false | true | java.lang.String | Scripting code run when a key is depressed. (HTML Pass-through) |
onkeypress | false | true | java.lang.String | Scripting code run when a key is pressed and released. (HTML Pass-through) |
onkeyup | false | true | java.lang.String | Scripting code run when a key is released. (HTML Pass-through) |
onmousedown | false | true | java.lang.String | Scripting code run when a mouse button is depressed. (HTML Pass-through) |
onmousemove | false | true | java.lang.String | Scripting code run when the mouse pointer is moved. (HTML Pass-through) |
onmouseout | false | true | java.lang.String | Scripting code run when the mouse pointer moves out of the element. (HTML Pass-through) |
onmouseover | false | true | java.lang.String | Scripting code run when the mouse pointer moves over the element. (HTML Pass-through) |
onmouseup | false | true | java.lang.String | Scripting code run when a mouse button is released. (HTML Pass-through) |
onselect | false | true | java.lang.String | Scripting code run when an element is selected. (HTML Pass-through) |
style | false | true | java.lang.String | Inline CSS style fragment that applies to the element (HTML Pass-through) |
tabindex | false | true | java.lang.String | The tab order of the element. (HTML Pass-through) |
title | false | true | java.lang.String | Tool-tip text for the element. (HTML Pass-through) |