public class DefaultErrorHandler extends Object implements ErrorHandler
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:
<b:FormGroup>
<b:FormLabel for="username">User</b:FormLabel>
<b:TextBox b:id="username" ui:field="username" />
<b:HelpBlock iconType="EXCLAMATION" />
</b:FormGroup>
Constructor and Description |
---|
DefaultErrorHandler(Widget widget)
Default error handler.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public DefaultErrorHandler(Widget widget)
parent
- the parent of this error handler.public void cleanup()
cleanup
in interface ErrorHandler
public void clearErrors()
clearErrors
in interface ErrorHandler
public void init()
HasValidationState
and sibling HelpBlock
only 1 time on initialization.public void showErrors(List<EditorError> errors)
showErrors
in interface ErrorHandler
errors
- the errors to display.Copyright © 2017. All rights reserved.