Interface HasValueAndElement<E extends HasValue.ValueChangeEvent<V>,V>
- Type Parameters:
E- the value change event typeV- the value type
- All Superinterfaces:
HasElement,HasEnabled,HasValue<E,,V> Serializable
- All Known Subinterfaces:
MultiSelect<C,,T> SingleSelect<C,T>
- All Known Implementing Classes:
AbstractCompositeField,AbstractField,AbstractNumberField,AbstractSinglePropertyField,BigDecimalField,Checkbox,CheckboxGroup,ComboBox,ComboBoxBase,CustomField,DatePicker,DateTimePicker,EmailField,Input,IntegerField,ListBox,ListBoxBase,MultiSelectComboBox,MultiSelectListBox,NumberField,PasswordField,RadioButtonGroup,RangeInput,RichTextEditor,Select,TextArea,TextField,TextFieldBase,TimePicker
- Since:
- 1.0
- Author:
- Vaadin Ltd
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.vaadin.flow.component.HasValue
HasValue.ValueChangeEvent<V>, HasValue.ValueChangeListener<E extends HasValue.ValueChangeEvent<?>> -
Method Summary
Modifier and TypeMethodDescriptiondefault booleanReturns whether thisHasValueis in read-only mode or not.default booleanChecks whether the required indicator is visible.default voidsetReadOnly(boolean readOnly) Sets the read-only mode of thisHasValueto given mode.default voidsetRequiredIndicatorVisible(boolean requiredIndicatorVisible) Sets the required indicator visible or not.Methods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabledMethods inherited from interface com.vaadin.flow.component.HasValue
addValueChangeListener, clear, getEmptyValue, getOptionalValue, getValue, isEmpty, setValue
-
Method Details
-
setRequiredIndicatorVisible
default void setRequiredIndicatorVisible(boolean requiredIndicatorVisible) Description copied from interface:HasValueSets 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
Binderwhich does server-side validation. In case HTML element has its own (client-side) validation it should be disabled whensetRequiredIndicatorVisible(true)is called and re-enabled back onsetRequiredIndicatorVisible(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 ownsetRequiredmethod which should be called in case the client-side validation is required.- Specified by:
setRequiredIndicatorVisiblein interfaceHasValue<E extends HasValue.ValueChangeEvent<V>,V> - Parameters:
requiredIndicatorVisible-trueto make the required indicator visible,falseif not
-
isRequiredIndicatorVisible
default boolean isRequiredIndicatorVisible()Description copied from interface:HasValueChecks whether the required indicator is visible.- Specified by:
isRequiredIndicatorVisiblein interfaceHasValue<E extends HasValue.ValueChangeEvent<V>,V> - Returns:
trueif visible,falseif not
-
setReadOnly
default void setReadOnly(boolean readOnly) Description copied from interface:HasValueSets the read-only mode of thisHasValueto given mode. The user can't change the value when in read-only mode.A
HasValuewith a visual component in read-only mode typically looks visually different to signal to the user that the value cannot be edited.- Specified by:
setReadOnlyin interfaceHasValue<E extends HasValue.ValueChangeEvent<V>,V> - Parameters:
readOnly- a boolean value specifying whether the component is put read-only mode or not
-
isReadOnly
default boolean isReadOnly()Description copied from interface:HasValueReturns whether thisHasValueis in read-only mode or not.- Specified by:
isReadOnlyin interfaceHasValue<E extends HasValue.ValueChangeEvent<V>,V> - Returns:
falseif the user can modify the value,trueif not.
-