Package com.vaadin.ui

Interface Field<T>

    • Method Detail

      • isRequired

        boolean isRequired()
        Is this field required. Required fields must filled by the user.
        Returns:
        true if the field is required,otherwise false.
        Since:
        3.1
      • setRequired

        void setRequired​(boolean required)
        Sets the field required. Required fields must filled by the user.
        Parameters:
        required - Is the field required.
        Since:
        3.1
      • setRequiredError

        void setRequiredError​(String requiredMessage)
        Sets the error message to be displayed if a required field is empty.
        Parameters:
        requiredMessage - Error message.
        Since:
        5.2.6
      • getRequiredError

        String getRequiredError()
        Gets the error message that is to be displayed if a required field is empty.
        Returns:
        Error message.
        Since:
        5.2.6
      • isEmpty

        boolean isEmpty()
        Is the field empty? In general, "empty" state is same as null. As an exception, TextField also treats empty string as "empty".
        Returns:
        true if the field is empty, false otherwise
        Since:
        7.4
      • clear

        void clear()
        Clears the value of the field.

        The field value is typically reset to the initial value of the field. Calling isEmpty() on a cleared field must always returns true.

        Since:
        7.4