You're viewing an older version of Vaadin JavaDoc. Please see version 24.7.0 for the latest.
com.vaadin.flow.component.textfield.

Interface HasPrefixAndSuffix

    • Method Detail

      • setPrefixComponent

        default void setPrefixComponent​(Component component)

        Adds the given component into this field before the content, replacing any existing prefix component.

        This is most commonly used to add a simple icon or static text into the field.

        Parameters:

        component - the component to set, can be null to remove existing prefix component

      • getPrefixComponent

        default Component getPrefixComponent()

        Gets the component in the prefix slot of this field.

        Returns:

        the prefix component of this field, or null if no prefix component has been set

        See Also:

        setPrefixComponent(Component)

      • setSuffixComponent

        default void setSuffixComponent​(Component component)

        Adds the given component into this field after the content, replacing any existing suffix component.

        This is most commonly used to add a simple icon or static text into the field.

        Parameters:

        component - the component to set, can be null to remove existing suffix component

      • getSuffixComponent

        default Component getSuffixComponent()

        Gets the component in the suffix slot of this field.

        Returns:

        the suffix component of this field, or null if no suffix component has been set

        See Also:

        setPrefixComponent(Component)