|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.stripes.tag.DefaultTagErrorRenderer
public class DefaultTagErrorRenderer
This default implementation of the TagErrorRenderer interface sets the html class attribute to 'error'. More specifically, if the tag had no previous CSS class, it will have its class attribute set to error. If it previously had a CSS class attribute, e.g. class="foo", then it's class attribute will be re-written as class="foo error", which instructs the browser to apply both styles, with error taking precedence. The use of a single class name allows applications to define a single style for all input fields, and then override it for specific fields as they choose.
An example of the css definition to set backgrounds to yellow by default, but to red for checkboxes and radio buttons follows:
input.error { background-color: yellow; }
input[type="checkbox"].error, input[type="radio"].error {background-color: red; }
Constructor Summary | |
---|---|
DefaultTagErrorRenderer()
|
Method Summary | |
---|---|
void |
doAfterEndTag()
Resets the tag's class attribute to it's original value in case the tag gets pooled. |
void |
doBeforeStartTag()
Ensures that the tag's list of CSS classes includes the "error" class. |
protected InputTagSupport |
getTag()
Returns the tag which is being rendered. |
void |
init(InputTagSupport tag)
Simply stores the tag passed in. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultTagErrorRenderer()
Method Detail |
---|
public void init(InputTagSupport tag)
init
in interface TagErrorRenderer
tag
- The InputTagSuppport subclass that will be modifiedprotected InputTagSupport getTag()
public void doBeforeStartTag()
doBeforeStartTag
in interface TagErrorRenderer
public void doAfterEndTag()
doAfterEndTag
in interface TagErrorRenderer
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |