Package com.vaadin.flow.component
Interface HasHelper
-
- All Superinterfaces:
HasElement,Serializable
- All Known Implementing Classes:
AbstractNumberField,BigDecimalField,CheckboxGroup,ComboBox,ComboBoxBase,CustomField,DatePicker,DateTimePicker,EmailField,IntegerField,MultiSelectComboBox,NumberField,PasswordField,RadioButtonGroup,Select,TextArea,TextField,TimePicker
public interface HasHelper extends HasElement
Mixin interface for field components that have helper text as property and slots for inserting components.- Since:
- 2.4
- Author:
- Vaadin Ltd
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default ComponentgetHelperComponent()Gets the component in the helper slot of this field.default StringgetHelperText()String used for the helper text.default voidsetHelperComponent(Component component)Adds the given component into helper slot of component, replacing any existing helper component.default voidsetHelperText(String helperText)String used for the helper text.-
Methods inherited from interface com.vaadin.flow.component.HasElement
getElement
-
-
-
-
Method Detail
-
getHelperText
default String getHelperText()
String used for the helper text.- Returns:
- the
helperTextproperty from the web component
-
setHelperText
default void setHelperText(String helperText)
String used for the helper text. It shows a text adjacent to the field that can be used, e.g., to inform to the users which values it expects. Example: a text "The password must contain numbers" for the PasswordField.
In case both
setHelperText(String)andsetHelperComponent(Component)are used, only the element defined bysetHelperComponent(Component)will be visible, regardless of the order on which they are defined.- Parameters:
helperText- the String value to set
-
setHelperComponent
default void setHelperComponent(Component component)
Adds the given component into helper slot of component, replacing any existing helper component. It adds the component adjacent to the field that can be used, e.g., to inform to the users which values it expects. Example: a component that shows the password strength for the PasswordField.- Parameters:
component- the component to set, can benullto remove existing helper component- See Also:
setHelperText(String)
-
getHelperComponent
default Component getHelperComponent()
Gets the component in the helper slot of this field.- Returns:
- the helper component of this field, or
nullif no helper component has been set - See Also:
setHelperComponent(Component)
-
-