Interface HasValidation

    • Method Detail

      • setErrorMessage

        void setErrorMessage​(String errorMessage)
        Sets an error message to the component.

        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 message
      • getErrorMessage

        String getErrorMessage()
        Gets current error message from the component.
        current error message
      • setInvalid

        void setInvalid​(boolean invalid)
        Sets the validity of the component input.

        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 validity
      • isInvalid

        boolean isInvalid()
        Returns true if component input is invalid, false otherwise.
        whether the component input is valid