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 String
bundle
The name of the servlet context attribute containing our message resources.
protected static Locale
defaultLocale
Deprecated. Use Locale.getDefault() directly.
protected boolean
disabled
Is this option disabled?
protected String
key
The key used to look up the text displayed to the user for this option, if any.
protected String
locale
The name of the attribute containing the Locale to be used for looking up internationalized messages.
protected static MessageResources
messages
The message resources for this package.
private String
style
The style associated with this tag.
private String
styleClass
The named style class associated with this tag.
protected String
styleId
The identifier associated with this tag.
protected String
text
The message text to be displayed to the user for this tag (if any)
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 Summary

int
doAfterBody()
Process the body text of this tag (if any).
int
doEndTag()
Process the end of this tag.
int
doStartTag()
Process the start of this tag.
String
getBundle()
boolean
getDisabled()
String
getKey()
String
getLocale()
String
getStyle()
String
getStyleClass()
String
getStyleId()
Return the style identifier for this tag.
String
getValue()
void
release()
Release any acquired resources.
protected String
renderOptionElement()
Generate an HTML %lt;option> element.
private SelectTag
selectTag()
Acquire the select tag we are associated with.
void
setBundle(String bundle)
void
setDisabled(boolean disabled)
void
setKey(String key)
void
setLocale(String locale)
void
setStyle(String style)
void
setStyleClass(String styleClass)
void
setStyleId(String styleId)
Set the style identifier for this tag.
void
setValue(String value)
protected String
text()
Return the text to be displayed to the user for this option (if any).

Field Details

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 Details

doAfterBody

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

doEndTag

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

doStartTag

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

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()
            throws JspException
Generate an HTML %lt;option> element.
Since:
Struts 1.1

selectTag

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

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()
            throws JspException
Return the text to be displayed to the user for this option (if any).

Copyright B) 2000-2007 - The Apache Software Foundation