org.apache.struts.taglib.html

Class OptionTag

public class OptionTag extends BodyTagSupport

Tag for select options. The body of this tag is presented to the user in the option list, while the value attribute is the value returned to the server if this option is selected.

Version: $Rev: 54929 $ $Date: 2004-10-16 17:38:42 +0100 (Sat, 16 Oct 2004) $

Field Summary
protected Stringbundle
The name of the servlet context attribute containing our message resources.
protected static LocaledefaultLocale
The default locale for our server.
protected booleandisabled
Is this option disabled?
protected Stringkey
The key used to look up the text displayed to the user for this option, if any.
protected Stringlocale
The name of the attribute containing the Locale to be used for looking up internationalized messages.
protected static MessageResourcesmessages
The message resources for this package.
Stringstyle
The style associated with this tag.
StringstyleClass
The named style class associated with this tag.
protected StringstyleId
The identifier associated with this tag.
protected Stringtext
The message text to be displayed to the user for this tag (if any)
protected Stringvalue
The server value for this option, also used to match against the current property value to determine whether this option should be marked as selected.
Method Summary
intdoAfterBody()
Process the body text of this tag (if any).
intdoEndTag()
Process the end of this tag.
intdoStartTag()
Process the start of this tag.
StringgetBundle()
booleangetDisabled()
StringgetKey()
StringgetLocale()
StringgetStyle()
StringgetStyleClass()
StringgetStyleId()
Return the style identifier for this tag.
StringgetValue()
voidrelease()
Release any acquired resources.
protected StringrenderOptionElement()
Generate an HTML %lt;option> element.
SelectTagselectTag()
Acquire the select tag we are associated with.
voidsetBundle(String bundle)
voidsetDisabled(boolean disabled)
voidsetKey(String key)
voidsetLocale(String locale)
voidsetStyle(String style)
voidsetStyleClass(String styleClass)
voidsetStyleId(String styleId)
Set the style identifier for this tag.
voidsetValue(String value)
protected Stringtext()
Return the text to be displayed to the user for this option (if any).

Field Detail

bundle

protected String bundle
The name of the servlet context attribute containing our message resources.

defaultLocale

protected static final Locale defaultLocale

Deprecated: Use Locale.getDefault() directly.

The default locale for our server.

disabled

protected boolean disabled
Is this option disabled?

key

protected String key
The key used to look up the text displayed to the user for this option, if any.

locale

protected String locale
The name of the attribute containing the Locale to be used for looking up internationalized messages.

messages

protected static MessageResources messages
The message resources for this package.

style

private String style
The style associated with this tag.

styleClass

private String styleClass
The named style class associated with this tag.

styleId

protected String styleId
The identifier associated with this tag.

text

protected String text
The message text to be displayed to the user for this tag (if any)

value

protected String value
The server value for this option, also used to match against the current property value to determine whether this option should be marked as selected.

Method Detail

doAfterBody

public int doAfterBody()
Process the body text of this tag (if any).

Throws: JspException if a JSP exception has occurred

doEndTag

public int doEndTag()
Process the end of this tag.

Throws: JspException if a JSP exception has occurred

doStartTag

public int doStartTag()
Process the start of this tag.

Throws: JspException if a JSP exception has occurred

getBundle

public String getBundle()

getDisabled

public boolean getDisabled()

getKey

public String getKey()

getLocale

public String getLocale()

getStyle

public String getStyle()

getStyleClass

public String getStyleClass()

getStyleId

public String getStyleId()
Return the style identifier for this tag.

getValue

public String getValue()

release

public void release()
Release any acquired resources.

renderOptionElement

protected String renderOptionElement()
Generate an HTML %lt;option> element.

Throws: JspException

Since: Struts 1.1

selectTag

private SelectTag selectTag()
Acquire the select tag we are associated with.

Throws: JspException

setBundle

public void setBundle(String bundle)

setDisabled

public void setDisabled(boolean disabled)

setKey

public void setKey(String key)

setLocale

public void setLocale(String locale)

setStyle

public void setStyle(String style)

setStyleClass

public void setStyleClass(String styleClass)

setStyleId

public void setStyleId(String styleId)
Set the style identifier for this tag.

Parameters: styleId The new style identifier

setValue

public void setValue(String value)

text

protected String text()
Return the text to be displayed to the user for this option (if any).

Throws: JspException if an error occurs

Copyright B) 2000-2009 - The Apache Software Foundation