|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.stripes.tag.StripesTagSupport
net.sourceforge.stripes.tag.HtmlTagSupport
net.sourceforge.stripes.tag.InputTagSupport
net.sourceforge.stripes.tag.InputOptionTag
public class InputOptionTag
Generates an <option value="foo">Fooey</option> HTML tag. Coordinates with an enclosing select tag to determine it's state (i.e. whether or not it is selected.) As a result some of the logic regarding state repopulation is a bit complex.
Since options can have only a single value per option the value attribute of the tag must be a scalar, which will be converted into a String using a Formatter if an appropriate one can be found, otherwise the toString() method will be invoked. The presence of a "selected" attribute is used as an indication that this option believes it should be selected by default - the value (as opposed to the presence) of the selected attribute is never used....
The option tag delegates to its enclosing select tag to determine whether or not it should
be selected. See the "select tag"
for documentation on how it
determines selection status. If the select tag has no opinion on selection state
(note that this is not the same as select tag deeming the option should not be selected) then
the presence of the selected attribute (or lack thereof) is used to turn selection on or off.
If the option has a body then the String value of that body will be used to generate the body of the generated HTML option. If the body is empty or not present then the label attribute will be written into the body of the tag.
Field Summary |
---|
Fields inherited from class net.sourceforge.stripes.tag.InputTagSupport |
---|
errorRenderer, fieldErrors |
Fields inherited from class net.sourceforge.stripes.tag.StripesTagSupport |
---|
pageContext, parentTag |
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag |
---|
EVAL_BODY_BUFFERED, EVAL_BODY_TAG |
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag |
---|
EVAL_BODY_AGAIN |
Fields inherited from interface javax.servlet.jsp.tagext.Tag |
---|
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
Constructor Summary | |
---|---|
InputOptionTag()
|
Method Summary | |
---|---|
int |
doAfterBody()
Does nothing. |
int |
doEndInputTag()
Locates the option's parent select tag, determines selection state and then writes out an option tag with an appropriate body. |
void |
doInitBody()
Does nothing. |
int |
doStartInputTag()
Does nothing. |
String |
getLabel()
Returns the value set with setLabel(). |
String |
getSelected()
Returns the value set with setSelected(). |
Object |
getValue()
Returns the value of the option as set with setValue(). |
protected void |
registerWithParentForm()
Overridden to make sure that options do not try and register themselves with the form tag. |
void |
setLabel(String label)
Sets the label that will be used as the option body if no body is supplied. |
void |
setSelected(String selected)
Sets whether or not this option believes it should be selected by default. |
void |
setValue(Object value)
Sets the value of this option. |
Methods inherited from class net.sourceforge.stripes.tag.InputTagSupport |
---|
doCatch, doEndTag, doFinally, doStartTag, format, format, getActionBean, getDisabled, getFieldErrors, getFormatPattern, getFormatType, getLocalizedFieldName, getLocalizedFieldName, getName, getOverrideValueOrValues, getParentFormTag, getReadonly, getSingleOverrideValue, getSize, getValidationMetadata, getValueOnPage, hasErrors, isItemSelected, loadErrors, makeFocused, setDisabled, setFocus, setFormatPattern, setFormatType, setName, setReadonly, setSize |
Methods inherited from class net.sourceforge.stripes.tag.HtmlTagSupport |
---|
evaluateExpression, get, getAccesskey, getAttributes, getBodyContent, getBodyContentAsString, getCssClass, getDir, getId, getLang, getOnblur, getOnchange, getOnclick, getOndblclick, getOnfocus, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getOnselect, getStyle, getTabindex, getTitle, release, set, setAccesskey, setBodyContent, setClass, setCssClass, setDir, setDynamicAttribute, setId, setLang, setOnblur, setOnchange, setOnclick, setOndblclick, setOnfocus, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setOnselect, setStyle, setTabindex, setTitle, toString, writeAttributes, writeCloseTag, writeOpenTag, writeSingletonTag |
Methods inherited from class net.sourceforge.stripes.tag.StripesTagSupport |
---|
getActionBeanType, getActionBeanUrl, getPageContext, getParent, getParentTag, getTagStack, popPageContextAttributes, pushPageContextAttributes, setPageContext, setParent |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface javax.servlet.jsp.tagext.BodyTag |
---|
setBodyContent |
Methods inherited from interface javax.servlet.jsp.tagext.Tag |
---|
doEndTag, doStartTag, getParent, release, setPageContext, setParent |
Constructor Detail |
---|
public InputOptionTag()
Method Detail |
---|
public void setValue(Object value)
public Object getValue()
public void setLabel(String label)
public String getLabel()
public void setSelected(String selected)
public String getSelected()
public int doStartInputTag() throws JspException
doStartInputTag
in class InputTagSupport
JspException
public void doInitBody() throws JspException
doInitBody
in interface BodyTag
JspException
public int doAfterBody() throws JspException
doAfterBody
in interface IterationTag
JspException
public int doEndInputTag() throws JspException
doEndInputTag
in class InputTagSupport
JspException
- if the option is not contained inside an InputSelectTag or output
cannot be written.protected void registerWithParentForm() throws StripesJspException
registerWithParentForm
in class InputTagSupport
StripesJspException
- if the parent form tag is not found
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |