|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.jsp.tagext.TagSupport
jp.terasoluna.fw.web.struts.taglib.ChangeStyleClassTag
public class ChangeStyleClassTag
Implementation class of changeStyleClass
tag.
Switches the class name of stylesheet depending on whether the error information
of the specified field is set or not.
When there is a error in the field of action form, this class is used to change the display
such as changing the part of that field to red.
In changeStyleClass
tag, following attributes are supported.
Attribute name | Default value | Required | Execution time format | Overview |
name |
- | true |
true |
Field name that determines whether the error information is set. |
default |
- | true |
true |
Stylesheet class name when there is no error. |
error |
- | true |
true |
Stylesheet class name when there is error. |
There is no scripting variable set by this tag.
<td class='<ts:changeStyleClass name="mou1"
default="gaid" error="error"/>'>
<input type="text" name="mou1">
</td>
Field Summary | |
---|---|
private java.lang.String |
defaultValue
Class name of stylesheet when there is no error in the field. |
private java.lang.String |
errorValue
Class name of stylesheet when there is error in the field. |
private static org.apache.commons.logging.Log |
log
Log class. |
private java.lang.String |
name
Field name that determines whether the error information is set. |
private static long |
serialVersionUID
Serail version ID |
Fields inherited from class javax.servlet.jsp.tagext.TagSupport |
---|
id, pageContext |
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 | |
---|---|
ChangeStyleClassTag()
|
Method Summary | |
---|---|
private java.lang.String |
chooseClass(javax.servlet.http.HttpServletRequest req,
java.lang.String fieldName,
java.lang.String ifNormal,
java.lang.String ifError)
Returns the class name of stylesheet depending on whether the error information is set in the specified field. |
int |
doEndTag()
Method which is called at the time of terminating tag evaluation. |
int |
doStartTag()
Method which is called at the time of starting tag evaluation. Changes the stylesheet class name depending on the error. |
void |
release()
Process at the time of releasing the tag handler. |
void |
setDefault(java.lang.String value)
Sets the class name of stylesheet when there is no error in the field. |
void |
setError(java.lang.String value)
Sets the class name of stylesheet when there is error in the field. |
void |
setName(java.lang.String name)
Sets the field name. |
Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
---|
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
private static org.apache.commons.logging.Log log
private java.lang.String name
private java.lang.String defaultValue
private java.lang.String errorValue
Constructor Detail |
---|
public ChangeStyleClassTag()
Method Detail |
---|
public void setName(java.lang.String name)
name
- Field namepublic void setDefault(java.lang.String value)
value
- Class name of stylesheet when there is no error.public void setError(java.lang.String value)
value
- Class name of stylesheet when there is a error.private java.lang.String chooseClass(javax.servlet.http.HttpServletRequest req, java.lang.String fieldName, java.lang.String ifNormal, java.lang.String ifError)
req
- HTTP requestfieldName
- Field nameifNormal
- Class name of stylesheet when there is no errorifError
- Class name of stylesheet when there is a error
public int doStartTag() throws javax.servlet.jsp.JspException
doStartTag
in interface javax.servlet.jsp.tagext.Tag
doStartTag
in class javax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.JspException
- JSP exceptionpublic int doEndTag() throws javax.servlet.jsp.JspException
doEndTag
in interface javax.servlet.jsp.tagext.Tag
doEndTag
in class javax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.JspException
- JSP exceptionpublic void release()
release
in interface javax.servlet.jsp.tagext.Tag
release
in class javax.servlet.jsp.tagext.TagSupport
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |