com.vaadin.flow.component.textfield.

Class PasswordField

    • Method Detail

      • setValueChangeMode

        public void setValueChangeMode(ValueChangeMode valueChangeMode)

        Description copied from interface: HasValueChangeMode

        Sets new value change mode for the component.

        Specified by:

        setValueChangeMode in interface HasValueChangeMode

        Parameters:

        valueChangeMode - new value change mode, or null to disable the value synchronization

      • getErrorMessage

        public String getErrorMessage()

        Description copied from interface: HasValidation

        Gets current error message from the component.

        Specified by:

        getErrorMessage in interface HasValidation

        Returns:

        current error message

      • isInvalid

        public boolean isInvalid()

        Description copied from interface: HasValidation

        Returns true if component input is invalid, false otherwise.

        Specified by:

        isInvalid in interface HasValidation

        Returns:

        whether the component input is valid

      • getLabel

        public String getLabel()

        String used for the label element.

        Returns:

        the label property from the webcomponent

      • getPlaceholder

        public String getPlaceholder()

        A hint to the user of what can be entered in the component.

        Returns:

        the placeholder property from the webcomponent

      • isAutofocus

        public boolean isAutofocus()

        Description copied from corresponding location in WebComponent:

        Specify that this control should have input focus when the page loads.

        This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.

        Returns:

        the autofocus property from the webcomponent

      • setMaxLength

        public void setMaxLength(int maxLength)

        Maximum number of characters (in Unicode code points) that the user can enter.

        Parameters:

        maxLength - the maximum length

      • getMaxLength

        public int getMaxLength()

        Description copied from corresponding location in WebComponent:

        Maximum number of characters (in Unicode code points) that the user can enter.

        This property is not synchronized automatically from the client side, so the returned value may not be the same as in client side.

        Returns:

        the maxlength property from the webcomponent

      • setMinLength

        public void setMinLength(int minLength)

        Minimum number of characters (in Unicode code points) that the user can enter.

        Parameters:

        minLength - the minimum length

      • getMinLength

        public int getMinLength()

        Minimum number of characters (in Unicode code points) that the user can enter.

        Returns:

        the minlength property from the webcomponent

      • isRequired

        public boolean isRequired()

        Specifies that the user must fill in a value.

        Returns:

        the required property from the webcomponent

      • isPreventInvalidInput

        public boolean isPreventInvalidInput()

        When set to true, user is prevented from typing a value that conflicts with the given pattern.

        Returns:

        the preventInvalidInput property from the webcomponent

      • setPreventInvalidInput

        public void setPreventInvalidInput(boolean preventInvalidInput)

        Description copied from class: GeneratedVaadinTextField

        Description copied from corresponding location in WebComponent:

        When set to true, user is prevented from typing a value that conflicts with the given pattern.

        Overrides:

        setPreventInvalidInput in class GeneratedVaadinTextField<PasswordField,String>

        Parameters:

        preventInvalidInput - the boolean value to set

      • setPattern

        public void setPattern(String pattern)

        Description copied from class: GeneratedVaadinTextField

        Description copied from corresponding location in WebComponent:

        A regular expression that the value is checked against. The pattern must match the entire value, not just some subset.

        Overrides:

        setPattern in class GeneratedVaadinTextField<PasswordField,String>

        Parameters:

        pattern - the String value to set

      • getPattern

        public String getPattern()

        A regular expression that the value is checked against. The pattern must match the entire value, not just some subset.

        Returns:

        the pattern property from the webcomponent

      • getTitle

        public String getTitle()

        Message to show to the user when validation fails.

        Returns:

        the title property from the webcomponent

      • isRevealButtonVisible

        public boolean isRevealButtonVisible()

        Set to false to hide the eye icon which toggles the password visibility.

        Returns:

        true if the button is visible, false otherwise

      • setRevealButtonVisible

        public void setRevealButtonVisible(boolean revealButtonVisible)

        Set to false to hide the eye icon which toggles the password visibility.

        Parameters:

        revealButtonVisible - true to set the button visible, false otherwise

      • setRequiredIndicatorVisible

        public void setRequiredIndicatorVisible(boolean requiredIndicatorVisible)

        Description copied from interface: HasValue

        Sets the required indicator visible or not.

        If set visible, it is visually indicated in the user interface.

        The method is intended to be used with Binder which does server-side validation. In case HTML element has its own (client-side) validation it should be disabled when setRequiredIndicatorVisible(true) is called and re-enabled back on setRequiredIndicatorVisible(false). It's responsibility of each component implementation to follow the contract so that the method call doesn't do anything else than show/hide the "required" indication. Usually components provide their own setRequired method which should be called in case the client-side validation is required.

        Specified by:

        setRequiredIndicatorVisible in interface HasValue<AbstractField.ComponentValueChangeEvent<PasswordField,String>,String>

        Specified by:

        setRequiredIndicatorVisible in interface HasValueAndElement<AbstractField.ComponentValueChangeEvent<PasswordField,String>,String>

        Parameters:

        requiredIndicatorVisible - true to make the required indicator visible, false if not