org.araneaframework.uilib.form
Class LocalFormElementValidationErrorRenderer
java.lang.Object
org.araneaframework.uilib.form.LocalFormElementValidationErrorRenderer
- All Implemented Interfaces:
- FormElementValidationErrorRenderer, Serializable
- public class LocalFormElementValidationErrorRenderer
- extends Object
- implements FormElementValidationErrorRenderer
Form element validation error renderer which produces error messages directly
attached to rendered FormElements.
- Since:
- 1.1
- Author:
- Taimo Peelo (taimo@araneaframework.org)
- See Also:
- Serialized Form
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
INSTANCE
public static final LocalFormElementValidationErrorRenderer INSTANCE
LocalFormElementValidationErrorRenderer
public LocalFormElementValidationErrorRenderer()
addError
public void addError(FormElement element,
String error)
- Description copied from interface:
FormElementValidationErrorRenderer
- Called by
FormElement.addError(String) to register validation errors.
- Specified by:
addError in interface FormElementValidationErrorRenderer
- Parameters:
element - element which produced the validation errorerror - detailed error message
clearErrors
public void clearErrors(FormElement element)
- Description copied from interface:
FormElementValidationErrorRenderer
- Called by
FormElement.clearErrors() to clear validation errors.
- Specified by:
clearErrors in interface FormElementValidationErrorRenderer
- Parameters:
element - element which errors should be cleared
getClientRenderText
public String getClientRenderText(FormElement element)
- Description copied from interface:
FormElementValidationErrorRenderer
- Returns client side script capable of rendering errors in desired format. This should
be in form that can be directly appended to rendered HTML and should be enclosed in
HTML <script> tags.
When the errors are rendered with some other mechanism, returns
null or empty String.
- Specified by:
getClientRenderText in interface FormElementValidationErrorRenderer
- Returns:
- script capable of rendering errors in desired format
getFormattedMessage
protected String getFormattedMessage(String msg)