Package com.vaadin.flow.component.shared
Interface HasClearButton
- All Superinterfaces:
HasElement,Serializable
- All Known Implementing Classes:
AbstractNumberField,BigDecimalField,ComboBox,ComboBoxBase,DatePicker,EmailField,IntegerField,MultiSelectComboBox,NumberField,PasswordField,TextArea,TextField,TextFieldBase,TimePicker
Mixin interface for components that support a clear button.
Used to toggle the visibility of the clear button.
- Author:
- Vaadin Ltd
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidbindClearButtonVisible(Signal<Boolean> signal) Binds a given signal to the visibility of the clear button.default booleanGets the visibility of the button which clears the field, which isfalseby default.default voidsetClearButtonVisible(boolean clearButtonVisible) Sets the visibility of the button which clears the field.Methods inherited from interface com.vaadin.flow.component.HasElement
getElement
-
Method Details
-
isClearButtonVisible
default boolean isClearButtonVisible()Gets the visibility of the button which clears the field, which isfalseby default.- Returns:
trueif the button is visible,falseotherwise
-
setClearButtonVisible
default void setClearButtonVisible(boolean clearButtonVisible) Sets the visibility of the button which clears the field.- Parameters:
clearButtonVisible-trueto show the clear button,falseto hide it
-
bindClearButtonVisible
Binds a given signal to the visibility of the clear button.When a signal is bound, the clear button visibility is kept synchronized with the signal value while the element is in the attached state. When the element is detached, signal value changes have no effect.
While a signal is bound, any attempt to set the visibility manually through
setClearButtonVisible(boolean)throws aBindingActiveException.Attempting to bind a new signal while one is already bound throws a
BindingActiveException.Signal's value
nullis treated asfalse.- Parameters:
signal- the signal to bind the clear button visibility to, notnull- Since:
- 25.1
- See Also:
-