org.araneaframework.uilib.form
Class StandardFormElementValidationErrorRenderer

java.lang.Object
  extended byorg.araneaframework.uilib.form.StandardFormElementValidationErrorRenderer
All Implemented Interfaces:
FormElementValidationErrorRenderer, Serializable

public class StandardFormElementValidationErrorRenderer
extends Object
implements FormElementValidationErrorRenderer

Form element validation error renderer which sends FormElement error messages to standard MessageContext.

Since:
1.1
Author:
Taimo Peelo (taimo@araneaframework.org)
See Also:
Serialized Form

Field Summary
static StandardFormElementValidationErrorRenderer INSTANCE
           
 
Fields inherited from interface org.araneaframework.uilib.form.FormElementValidationErrorRenderer
ERRORS_PROPERTY_KEY, RENDERED_FORMELEMENTERROR_STYLECLASS
 
Constructor Summary
StandardFormElementValidationErrorRenderer()
           
 
Method Summary
 void addError(FormElement element, String error)
          Called by FormElement.addError(String) to register validation errors.
 void clearErrors(FormElement element)
          Called by FormElement.clearErrors() to clear validation errors.
 String getClientRenderText(FormElement element)
          Returns client side script capable of rendering errors in desired format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final StandardFormElementValidationErrorRenderer INSTANCE
Constructor Detail

StandardFormElementValidationErrorRenderer

public StandardFormElementValidationErrorRenderer()
Method Detail

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 error
error - 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