|
||||||||||
| 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.InputOptionsEnumerationTag
public class InputOptionsEnumerationTag
Writes a set of <option value="foo">bar</option> tags to the page based on the values of a enum. Each value in the enum is represented by a single option tag on the page. The options will be generated in ordinal value order (i.e. the order they are declared in the enum). Uses the label attribute on the tag to name the property of the enum that should be used to generate the body of the HTML option tag. If the label attribute is not set then the tag will call toString() on the enum value and use that as the body of the tag.
E.g. a tag declaration that looks like:
<stripes:options-enumeration collection="net.kitty.EyeColor"/>
would result in the tag attempting to invoke
Class.forName("net.kitty.EyeColor") and cast the result to type Class
All other attributes on the tag (other than enum and label) are passed directly through to the InputOptionTag which is used to generate the individual HTML options tags. As a result the InputOptionsCollectionTag will exhibit the same re-population/selection behaviour as the regular options tag.
Since the tag has no use for one it does not allow a body.
| Field Summary |
|---|
| Fields inherited from class net.sourceforge.stripes.tag.StripesTagSupport |
|---|
pageContext, parentTag |
| Fields inherited from interface javax.servlet.jsp.tagext.Tag |
|---|
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
| Constructor Summary | |
|---|---|
InputOptionsEnumerationTag()
|
|
| Method Summary | |
|---|---|
int |
doEndTag()
Does nothing. |
int |
doStartTag()
Attempts to instantiate the Class object representing the enum and fetch the values of the enum. |
String |
getEnum()
Gets the enum class name set with setEnum(). |
String |
getLabel()
Gets the name of the property that will be used to generate the option's label. |
void |
setEnum(String name)
Sets the fully qualified name of an enumeration class. |
void |
setLabel(String label)
Sets the name of the property that will be used to generate the option's label. |
| 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, 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 |
|---|
getPageContext, getParent, getParentTag, 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.Tag |
|---|
getParent, release, setPageContext, setParent |
| Constructor Detail |
|---|
public InputOptionsEnumerationTag()
| Method Detail |
|---|
public void setEnum(String name)
public String getEnum()
public void setLabel(String label)
public String getLabel()
public int doStartTag()
throws JspException
doStartTag in interface TagdoStartTag in class StripesTagSupportJspException - if the class name supplied is not a valid class, or cannot be cast
to Class
public int doEndTag()
throws JspException
doEndTag in interface TagdoEndTag in class StripesTagSupportJspException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||