Interface HasPlaceholder
- All Superinterfaces:
HasElement,Serializable
- All Known Implementing Classes:
AbstractNumberField,BigDecimalField,ComboBox,ComboBoxBase,DatePicker,EmailField,Input,IntegerField,MultiSelectComboBox,NumberField,PasswordField,Select,TextArea,TextField,TextFieldBase,TimePicker
A placeholder is a text that should be displayed in the input element, when the user has not entered a value.
The default implementations sets the placeholder property for
this element. Override all methods in this interface if the placeholder
should be set in some other way.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidbindPlaceholder(Signal<String> placeholderSignal) Binds a signal's value to the component's placeholder so that the placeholder is updated when the signal's value is updated.default StringThe placeholder text that should be displayed in the input element, when the user has not entered a valuedefault voidsetPlaceholder(String placeholder) Sets the placeholder text that should be displayed in the input element, when the user has not entered a valueMethods inherited from interface com.vaadin.flow.component.HasElement
getElement
-
Method Details
-
setPlaceholder
Sets the placeholder text that should be displayed in the input element, when the user has not entered a value- Parameters:
placeholder- the placeholder text, may be null.
-
getPlaceholder
The placeholder text that should be displayed in the input element, when the user has not entered a value- Returns:
- the
placeholderproperty from the web component. May be null if not yet set.
-
bindPlaceholder
Binds a signal's value to the component's placeholder so that the placeholder is updated when the signal's value is updated.Passing
nullas thesignalremoves any existing binding for the given placeholder. When unbinding, the current placeholder is left unchanged.While a binding for the placeholder is active, any attempt to set the placeholder manually throws
BindingActiveException. The same happens when trying to bind a new signal while one is already bound.Bindings are lifecycle-aware and only active while this component is in the attached state; they are deactivated while the component is in the detached state.
- Parameters:
placeholderSignal- the signal to bind, notnull- Throws:
BindingActiveException- thrown when there is already an existing binding- Since:
- 25.1
- See Also:
-