public interface HasValidation extends Serializable
Modifier and Type | Method and Description |
---|---|
String |
getErrorMessage()
Gets current error message from the component.
|
boolean |
isInvalid()
Returns
true if component input is invalid, false
otherwise. |
void |
setErrorMessage(String errorMessage)
Sets an error message to the component.
|
void |
setInvalid(boolean invalid)
Sets the validity of the component input.
|
void setErrorMessage(String errorMessage)
The Web Component is responsible for deciding when to show the error message to the user, and this is usually triggered by triggering the invalid state for the Web Component. Which means that there is no need to clean up the message when component becomes valid (otherwise it may lead to undesired visual effects).
errorMessage
- a new error messageString getErrorMessage()
void setInvalid(boolean invalid)
When component becomes valid it hides the error message by itself, so
there is no need to clean up the error message via the
setErrorMessage(String)
call.
invalid
- new value for component input validityboolean isInvalid()
true
if component input is invalid, false
otherwise.Copyright © 2018. All rights reserved.