|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.servlet.jsp.tagext.TagSupport
com.taggercat.tags.DataFieldCaptionTag
public class DataFieldCaptionTag
This tag displays the caption of the named data field.
This tag has three roles.
i18nFieldCaptionstrue to enable internationalize for all Data Field CaptionsPropertyCaptions.propertiesCustomer.name<tc:fieldCaption dsn='customer' field='TERRITORY' default='Territory' /> <tc:fieldCaption dsn='customer' field='TERRITORY' default='Territory' static='true' />
default attribute is used when internationalization is not enabled and there
no caption is set in the metadata ,
or if the static attribute is 'true'. If the static attribute is 'true', then the
default attribute is always used, and there is no attempt to read the caption from the
metadata.
Highlighting Error Fields
Field Captions can be highlighted in the event of validation and certain other types of errors.
To enable highlighting of the captions on error fields, a context-param named errorFieldFormat must
be included in the application's deployment descriptor.
The parameter value is used as a format string (usually a CSS class ) to embed the field's caption into.
It is important to note that this is a <context-param>, and NOT a <init-param>
in the <servlet/> element.
The format string must contain a single {0} placeholder for the field caption. Also note that any HTML
within the param-value element must be escaped or inclosed in a CDATA section.
Here is an example section of a web.xml file:
<web-app> <display-name>Order Processing</display-name>
<context-param> <param-name>errorFieldFormat</param-name> <param-value><![CDATA[<span class="errorCaption">{0}</span>]]></param-value> </context-param>
<servlet> ...... </servlet>

| Field Summary |
|---|
| 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 | |
|---|---|
DataFieldCaptionTag()
|
|
| Method Summary | |
|---|---|
int |
doEndTag()
Resets the tags internal state. |
int |
doStartTag()
Creates the field's caption. |
void |
setDefault(java.lang.String defaultCaption)
Sets the default caption string, used when there is no caption. |
void |
setDefaultCaption(java.lang.String defaultCaption)
Sets the default caption. |
void |
setDsn(java.lang.String dsn)
Set the name of the data source this field is a member of. |
void |
setField(java.lang.String field)
Sets the field name attribute. |
void |
setStatic(boolean isStatic)
Sets the isStatic field. |
void |
setStatic(java.lang.String isStatic)
Sets the static attribute,if set true, the "default" caption is always used for the caption. |
java.lang.String |
toString()
Returns a string representation of this tag. |
| Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
|---|
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DataFieldCaptionTag()
| Method Detail |
|---|
public int doEndTag()
throws javax.servlet.jsp.JspException
doEndTag in interface javax.servlet.jsp.tagext.TagdoEndTag in class javax.servlet.jsp.tagext.TagSupportjavax.servlet.jsp.JspException
public int doStartTag()
throws javax.servlet.jsp.JspException
doStartTag in interface javax.servlet.jsp.tagext.TagdoStartTag in class javax.servlet.jsp.tagext.TagSupportjavax.servlet.jsp.JspException
public void setDefault(java.lang.String defaultCaption)
defaultCaption - the new default caption valuepublic void setDsn(java.lang.String dsn)
dsn - the data source namepublic void setField(java.lang.String field)
field - the new field valuepublic void setStatic(java.lang.String isStatic)
isStatic - the isStatic valuepublic java.lang.String toString()
toString in class java.lang.Objectpublic void setDefaultCaption(java.lang.String defaultCaption)
defaultCaption - the default captionpublic void setStatic(boolean isStatic)
isStatic - the isStatic field
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||