The Common-Controls Tag Library

<base:option>

The tag generates a single option element. It can be used within a <html:select>- or <forms:select>-Tag. The selected element will be set by the surrounding tag.

Body content: JSP
Tag class: OptionTag
 

[ Syntax ]

Standard Syntax
<base:option
key = "String"
[ disabled = "boolean" ]
[ filter = "boolean" ]
[ label = "String" ]
[ maxlength = "Integer" ]
[ style = "String" ]
[ styleClass = "String" ]
[ styleId = "String" ]
>
...Body Content...

</base:option>
 

[ Attributes ]

AttributeTypeDescriptionReq.RTExp
disabledboolean This attribute can be used to disable the control element. It then does not accept any user inputs and does not generate any control element events.  
filterboolean The automatic HTML coding of the column contents can be activated or disabled with the filter-attribute.  
keyString Specifies the name of the property which returns the key of the option.
labelString Specifies the label or a resource key of the option. It's also possible to specify the text within the bopy of the tag.

The character string is first HTML-encoded.

 
maxlengthInteger Specifies the maximum number of characters for the displayed option element.  
styleString An HTML-style can be directly specified with this attribute.

Annotation: See HTML documentation for the attribute style.

 
styleClassString The HTML-class attribute of the element can be specified with this attribute.

Annotation: See HTML documentation for the attribute class.

 
styleIdString The HTML-id attribute of the element can be specified with this attribute.

Annotation: See HTML documentation for the Attribute id.

 

[ Example ]

The example generates an option element within a <html:select> tag.


<%@ taglib uri="http://struts.apache.org/tags-html"             prefix="html" %>
<%@ taglib uri="http://www.common-controls.com/cc/tags-base"   prefix="base" %>

<td nowrap>Change Status:</td>
<td>
    <html:select property="state">
        <base:option key="open" label="states.open"/>
        <base:option key="closed">Closed</base:option>
    </html:select>
</td>