public class

OptionsTag

extends AbstractHtmlElementTag
java.lang.Object
   ↳ TagSupport
     ↳ org.springframework.web.servlet.tags.RequestContextAwareTag
       ↳ org.springframework.web.servlet.tags.HtmlEscapingAwareTag
         ↳ org.springframework.web.servlet.tags.form.AbstractFormTag
           ↳ org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
             ↳ org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
               ↳ org.springframework.web.servlet.tags.form.OptionsTag

Class Overview

Convenient tag that allows one to supply a collection of objects that are to be rendered as 'option' tags within a 'select' tag.

Must be used within a 'select' tag.

Summary

[Expand]
Inherited Constants
From class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
From class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
From class org.springframework.web.servlet.tags.RequestContextAwareTag
[Expand]
Inherited Fields
From class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
From class org.springframework.web.servlet.tags.RequestContextAwareTag
Public Constructors
OptionsTag()
Public Methods
void setDisabled(String disabled)
Set the value of the 'disabled' attribute.
void setItemLabel(String itemLabel)
Set the name of the property mapped to the label (inner text) of the 'option' tag.
void setItemValue(String itemValue)
Set the name of the property mapped to the 'value' attribute of the 'option' tag.
void setItems(Object items)
Set the Collection, Map or array of objects used to generate the inner 'option' tags.
Protected Methods
BindStatus getBindStatus()
Get the BindStatus for this tag.
String getDisabled()
Get the value of the 'disabled' attribute.
String getItemLabel()
Get the name of the property mapped to the label (inner text) of the 'option' tag.
String getItemValue()
Return the name of the property mapped to the 'value' attribute of the 'option' tag.
Object getItems()
Get the Collection, Map or array of objects used to generate the inner 'option' tags.
boolean isDisabled()
Is the current HTML tag disabled?
String resolveId()
Appends a counter to a specified id, since we're dealing with multiple HTML elements.
int writeTagContent(TagWriter tagWriter)
Subclasses should implement this method to perform tag content rendering.
[Expand]
Inherited Methods
From class org.springframework.web.servlet.tags.form.AbstractHtmlElementTag
From class org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag
From class org.springframework.web.servlet.tags.form.AbstractFormTag
From class org.springframework.web.servlet.tags.HtmlEscapingAwareTag
From class org.springframework.web.servlet.tags.RequestContextAwareTag
From class java.lang.Object
From interface org.springframework.web.servlet.tags.EditorAwareTag

Public Constructors

public OptionsTag ()

Public Methods

public void setDisabled (String disabled)

Set the value of the 'disabled' attribute.

May be a runtime expression.

Parameters
disabled the value of the 'disabled' attribute

public void setItemLabel (String itemLabel)

Set the name of the property mapped to the label (inner text) of the 'option' tag.

May be a runtime expression.

public void setItemValue (String itemValue)

Set the name of the property mapped to the 'value' attribute of the 'option' tag.

Required when wishing to render 'option' tags from an array or Collection.

May be a runtime expression.

public void setItems (Object items)

Set the Collection, Map or array of objects used to generate the inner 'option' tags.

Required when wishing to render 'option' tags from an array, Collection or Map.

Typically a runtime expression.

Protected Methods

protected BindStatus getBindStatus ()

Get the BindStatus for this tag.

protected String getDisabled ()

Get the value of the 'disabled' attribute.

protected String getItemLabel ()

Get the name of the property mapped to the label (inner text) of the 'option' tag.

May be a runtime expression.

protected String getItemValue ()

Return the name of the property mapped to the 'value' attribute of the 'option' tag.

protected Object getItems ()

Get the Collection, Map or array of objects used to generate the inner 'option' tags.

Typically a runtime expression.

protected boolean isDisabled ()

Is the current HTML tag disabled?

Returns
  • true if this tag is disabled
Throws
JspException

protected String resolveId ()

Appends a counter to a specified id, since we're dealing with multiple HTML elements.

Throws
JspException

protected int writeTagContent (TagWriter tagWriter)

Subclasses should implement this method to perform tag content rendering.

Returns
  • valid tag render instruction as per javax.servlet.jsp.tagext.Tag#doStartTag().
Throws
JspException