org.apache.beehive.netui.tags.html
Class SelectOption

Object
  extended by TagSupport
      extended by BodyTagSupport
          extended by AbstractClassicTag
              extended by HtmlBaseTag
                  extended by SelectOption
All Implemented Interfaces:
Serializable, BodyTag, IterationTag, JspTag, Tag, HtmlConstants, IAttributeConsumer, IHtmlAttrs, IHtmlCore, IHtmlEvents, IHtmlI18n, INetuiTag

public class SelectOption
extends HtmlBaseTag

An option whose state is determined by its enclosing SelectOption.

See Also:
Serialized Form
Example
The following sample generates a set of <option> tags.
    <netui:form action="submit">
        <netui:select dataSource="actionForm.selections" size="5">
            <netui:selectOption value="red" />
            <netui:selectOption value="blue" />
            <netui:selectOption value="green" />
            <netui:selectOption value="yellow" />
            <netui:selectOption value="orange" />
        </netui:select>
        <netui:button type="submit" value="Submit"/>
    </netui:form>

Field Summary
 
Fields inherited from class AbstractClassicTag
DefaultNamingChain, EMPTY_STRING, NETUI_UNIQUE_CNT
 
Fields inherited from class BodyTagSupport
bodyContent
 
Fields inherited from class TagSupport
id, pageContext
 
Fields inherited from interface HtmlConstants
ABBR, ACCEPT, ACCESSKEY, ACTION, ALIGN, ALINK, ALT, ANCHOR, AREA, AXIS, BACKGROUND, BASE, BGCOLOR, BODY, BORDER, BR, BUTTON, CAPTION, CELLPADDING, CELLSPACING, CHAR, CHAROFF, CHARSET, CHECKED, CLASS, COLS, COLSPAN, COORDS, DIR, DISABLED, DIV, ENCTYPE, FOR, FORM, FORM_GET, FORM_POST, FRAME, HEADERS, HEIGHT, HREF, HREFLANG, HSPACE, HTML, ID, IMAGE, INPUT, INPUT_BUTTON, INPUT_CHECKBOX, INPUT_FILE, INPUT_HIDDEN, INPUT_IMAGE, INPUT_PASSWORD, INPUT_RADIO, INPUT_RESET, INPUT_SUBMIT, INPUT_TEXT, ISMAP, LABEL, LANG, LANGUAGE, LINK, LONGDESC, MAXLENGTH, METHOD, NAME, ONBLUR, ONCHANGE, ONCLICK, ONDBLCLICK, ONFOCUS, ONKEYDOWN, ONKEYPRESS, ONKEYUP, ONLOAD, ONMOUSEDOWN, ONMOUSEMOVE, ONMOUSEOUT, ONMOUSEOVER, ONMOUSEUP, ONRESET, ONSELECT, ONSUBMIT, ONUNLOAD, OPTION, READONLY, REL, REV, ROWS, ROWSPAN, RULES, SCOPE, SCRIPT, SELECT, SHAPE, SIZE, SPAN, SRC, STYLE, SUMMARY, TABINDEX, TABLE, TARGET, TBODY, TD, TEXT, TEXTAREA, TFOOT, TH, THEAD, TITLE, TR, TYPE, USEMAP, VALIGN, VALUE, VLINK, VSPACE, WIDTH
 
Fields inherited from interface BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
Fields inherited from interface IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
SelectOption()
           
 
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.
 boolean getDisabled()
          Gets if this option is disabled or not.
protected  AbstractHtmlState getState()
          This method will return the state associated with the tag.
 String getTagName()
          Return the name of the Tag.
protected  boolean isDisabled()
          This method will a boolean indicating if the control is disabled or not.
protected  void localRelease()
          Release any acquired resources.
 void setAttribute(String name, String value, String facet)
          Base support for the attribute tag.
 void setDisabled(boolean disabled)
          Set if this option is disabled or not.
 void setRepeatingType(String repeatingType)
          If the selectOption is being used inside a repeating Select, this defines the Select attribute used to generate the option elements.
 void setValue(String value)
          Set the value of this SelectOption.
 
Methods inherited from class HtmlBaseTag
getJavaScriptAttribute, getOnClick, getTagId, renderDefaultNameAndId, renderNameAndId, setDir, setLang, setOnClick, setOnDblClick, setOnKeyDown, setOnKeyPress, setOnKeyUp, setOnMouseDown, setOnMouseMove, setOnMouseOut, setOnMouseOver, setOnMouseUp, setStateAttribute, setStyle, setStyleClass, setTagId, setTitle
 
Methods inherited from class AbstractClassicTag
applyNamingChain, getErrorsReport, getIdForTagId, getNamingChain, getNearestForm, getNextId, getScriptReporter, getUserLocale, hasErrors, qualifyAttribute, registerTagError, registerTagError, reportAndExit, reportErrors, rewriteName, setNonEmptyValueAttribute, setRequiredValueAttribute, write
 
Methods inherited from class BodyTagSupport
doInitBody, getBodyContent, getPreviousOut, release, setBodyContent
 
Methods inherited from class TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface Tag
getParent, setPageContext, setParent
 

Constructor Detail

SelectOption

public SelectOption()
Method Detail

getTagName

public String getTagName()
Return the name of the Tag.

Specified by:
getTagName in interface INetuiTag
Specified by:
getTagName in class AbstractClassicTag
Returns:
the name of the tag.

setAttribute

public void setAttribute(String name,
                         String value,
                         String facet)
                  throws JspException
Base support for the attribute tag. This is overridden to prevent setting the value attribute.

Specified by:
setAttribute in interface IAttributeConsumer
Overrides:
setAttribute in class HtmlBaseTag
Parameters:
name - The name of the attribute
value - The value of the attribute
facet - The name of a facet to which the attribute will be applied. This is optional.
Throws:
JspException - A JspException may be thrown if there is an error setting the attribute.

getState

protected AbstractHtmlState getState()
This method will return the state associated with the tag. This is used by this base class to access the individual state objects created by the tags.

Specified by:
getState in class HtmlBaseTag
Returns:
a subclass of the AbstractHtmlState class.

getDisabled

public boolean getDisabled()
Gets if this option is disabled or not.

Returns:
the disabled state ("true" or "false")

setDisabled

public void setDisabled(boolean disabled)
Set if this option is disabled or not.

Parameters:
disabled - "true" or "false"

isDisabled

protected boolean isDisabled()
                      throws JspException
This method will a boolean indicating if the control is disabled or not. This will cause the disable attribute to be evaluated which may result in a runtime error or a JspException.

Returns:
true if the control is disabled.
Throws:
JspException - on an exception.

setRepeatingType

public void setRepeatingType(String repeatingType)
If the selectOption is being used inside a repeating Select, this defines the Select attribute used to generate the option elements.

Parameters:
repeatingType - Value of "option", "dataSource", "default", (for optionsDataSource, dataSource, and defaultValue attributes respectively) or "null"

setValue

public void setValue(String value)
              throws JspException
Set the value of this SelectOption.

Parameters:
value - the SelectOption value
Throws:
JspException

doStartTag

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

Specified by:
doStartTag in interface Tag
Overrides:
doStartTag in class BodyTagSupport
Throws:
JspException - if a JSP exception has occurred

doAfterBody

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

Specified by:
doAfterBody in interface IterationTag
Overrides:
doAfterBody in class BodyTagSupport
Throws:
JspException - if a JSP exception has occurred

doEndTag

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

Specified by:
doEndTag in interface Tag
Overrides:
doEndTag in class BodyTagSupport
Throws:
JspException - if a JSP exception has occurred

localRelease

protected void localRelease()
Release any acquired resources.

Overrides:
localRelease in class HtmlBaseTag