org.gwtbootstrap3.client.ui.form.error
Class DefaultErrorHandler

java.lang.Object
  extended by org.gwtbootstrap3.client.ui.form.error.DefaultErrorHandler
All Implemented Interfaces:
ErrorHandler

public class DefaultErrorHandler
extends Object
implements ErrorHandler

This is the default ErrorHandler implementation. The assumption is that every ValueBoxBase instance will have a HasValidationState parent. If there is a HelpBlock that is a child of the HasValidationState parent then error messages will be displayed in the HelpBlock. Example:

  
      User 
       
       
 
 

Author:
Steven Jardine

Constructor Summary
DefaultErrorHandler(Widget widget)
          Default error handler.
 
Method Summary
 void cleanup()
          Clean up the handler if necessary.
 void clearErrors()
          Clear any errors.
 void init()
          Initialize the instance.
 void showErrors(List<EditorError> errors)
          Show the errors on the input screen.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultErrorHandler

public DefaultErrorHandler(Widget widget)
Default error handler.

Parameters:
parent - the parent of this error handler.
Method Detail

cleanup

public void cleanup()
Clean up the handler if necessary.

Specified by:
cleanup in interface ErrorHandler

clearErrors

public void clearErrors()
Clear any errors.

Specified by:
clearErrors in interface ErrorHandler

init

public void init()
Initialize the instance. We find the parent HasValidationState and sibling HelpBlock only 1 time on initialization.


showErrors

public void showErrors(List<EditorError> errors)
Show the errors on the input screen.

Specified by:
showErrors in interface ErrorHandler
Parameters:
errors - the errors to display.


Copyright © 2015. All rights reserved.