The Common-Controls Tag Library

<base:options>

The tag generates the option list with the help of a data model for a <html:select>- or <forms:select>-tag. The tag can thereby process some of the basic data types of the framework.

Tag class: OptionsTag
 

[ Syntax ]

Standard Syntax
<base:options
[ empty = "String" ]
[ filter = "boolean" ]
[ imagemap = "String" ]
[ keyProperty = "String" ]
[ labelProperty = "String" ]
[ localize = "Boolean" ]
[ maxlength = "Integer" ]
[ name = "String" ]
[ property = "String" ]
[ root = "Boolean" ]
[ style = "String" ]
[ styleClass = "String" ]
[ tooltipProperty = "String" ]
/>
 

[ Attributes ]

AttributeTypeDescriptionReq.RTExp
emptyString Specifies the label of an additional empty-entry. What is involved here is an entry with an empty key. This is always required when the null-value is also to be offered in the list.  
filterboolean The automatic HTML coding of the column contents can be activated or disabled with the filter-attribute.  
imagemapString Specifies the name of an Image-Map which must be saved in the request. The value returned from the option element is mapped to the entries of this Imagemap. The mapping is done with the help of the regular expression, which is assigned to every entry of the Imagemap.

Annotation: Under the name, there must be an ImageMap saved in the request.

 
keyPropertyString Specifies the name of the property which returns the key of the option.

Annotation: Valid Java designator/label for a property which has to be implemented from the elements of the collection.

 
labelPropertyString Specifies the name of the property which supplies the display text of the option.

The character string is first HTML-encoded.

Annotation: Valid Java designator/label for a property which has to be implemented from the elements of the collection.

 
localizeBoolean If this flag is set to true the framework interprets all labels as resource identifiers and localize them. If the flag is set to false the labels are treated as string literals without localization.  
maxlengthInteger Specifies the maximum number of characters for the displayed option elements.  
nameString Specifies the name of the Java-Bean. The Java-Bean must be stored in the given scope.

When the tag is surrounded by a Struts <html:form> tag, no Bean Name need be specified. In this case, the Java-Bean is drawn via a property of the Struts Form Bean.

Annotation: A valid Java identifier must be given.

 
propertyString Specifies the name of the property using which the Java-Bean is to be accessed. This is generally only necessary when the Java-Bean is associated with a Struts Form Bean.

Annotation: A valid Java identifier must be given.

 
rootBoolean Specifies if the root element should be displayed. This is available for an option list based on a TreeNodeDataModel.  
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.

 
tooltipPropertyString Specifies the name of the property which will return the tooltip for the option element.

The String will be HTML-encoded.

Annotation: A valid Java identifier which needs to be implemented by the elements within the collection.

 

[ Example ]

Generates a simple option list. The property stateOptions returns an object that implements the OptionListDataModel Interface.


<%@ 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:options property="stateOptions"/>
    </html:select>
</td>