org.araneaframework.uilib.form
Interface FormElementValidationErrorRenderer

All Superinterfaces:
Serializable
All Known Implementing Classes:
LocalFormElementValidationErrorRenderer, StandardFormElementValidationErrorRenderer

public interface FormElementValidationErrorRenderer
extends Serializable

Interface through which FormElements register the error messages produced by failed validation.

Since:
1.1
Author:
Taimo Peelo (taimo@araneaframework.org)
See Also:
StandardFormElementValidationErrorRenderer, LocalFormElementValidationErrorRenderer

Field Summary
static String ERRORS_PROPERTY_KEY
          FormElement property key (see GenericFormElement.getProperty(Object)) under which validation errors may be stored.
static String RENDERED_FORMELEMENTERROR_STYLECLASS
          Style class which should be present on all DOM elements which contain the rendered errors.
 
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.
 

Field Detail

ERRORS_PROPERTY_KEY

public static final String ERRORS_PROPERTY_KEY
FormElement property key (see GenericFormElement.getProperty(Object)) under which validation errors may be stored.

See Also:
Constant Field Values

RENDERED_FORMELEMENTERROR_STYLECLASS

public static final String RENDERED_FORMELEMENTERROR_STYLECLASS
Style class which should be present on all DOM elements which contain the rendered errors.

See Also:
Constant Field Values
Method Detail

addError

public void addError(FormElement element,
                     String error)
Called by FormElement.addError(String) to register validation errors.

Parameters:
element - element which produced the validation error
error - detailed error message

clearErrors

public void clearErrors(FormElement element)
Called by FormElement.clearErrors() to clear validation errors.

Parameters:
element - element which errors should be cleared

getClientRenderText

public String getClientRenderText(FormElement element)
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.

Returns:
script capable of rendering errors in desired format