E
- the value change event typeV
- the value typepublic interface HasValueAndElement<E extends HasValue.ValueChangeEvent<V>,V> extends HasValue<E,V>, HasElement, HasEnabled
HasValue.ValueChangeEvent<V>, HasValue.ValueChangeListener<E extends HasValue.ValueChangeEvent<?>>
Modifier and Type | Method and Description |
---|---|
default boolean |
isReadOnly()
Returns whether this
HasValue is in read-only mode or not. |
default boolean |
isRequiredIndicatorVisible()
Checks whether the required indicator is visible.
|
default void |
setReadOnly(boolean readOnly)
Sets the read-only mode of this
HasValue to given mode. |
default void |
setRequiredIndicatorVisible(boolean requiredIndicatorVisible)
Sets the required indicator visible or not.
|
addValueChangeListener, clear, getEmptyValue, getOptionalValue, getValue, isEmpty, setValue
isEnabled, setEnabled
getElement
default void setRequiredIndicatorVisible(boolean requiredIndicatorVisible)
HasValue
If set visible, it is visually indicated in the user interface.
The method is intended to be used with Binder
which does
server-side validation. In case HTML element has its own (client-side)
validation it should be disabled when
setRequiredIndicatorVisible(true)
is called and re-enabled
back on setRequiredIndicatorVisible(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 own
setRequired
method which should be called in case the
client-side validation is required.
setRequiredIndicatorVisible
in interface HasValue<E extends HasValue.ValueChangeEvent<V>,V>
requiredIndicatorVisible
- true
to make the required indicator visible,
false
if notdefault boolean isRequiredIndicatorVisible()
HasValue
isRequiredIndicatorVisible
in interface HasValue<E extends HasValue.ValueChangeEvent<V>,V>
true
if visible, false
if notdefault void setReadOnly(boolean readOnly)
HasValue
HasValue
to given mode. The user
can't change the value when in read-only mode.
A HasValue
with a visual component in read-only mode typically
looks visually different to signal to the user that the value cannot be
edited.
setReadOnly
in interface HasValue<E extends HasValue.ValueChangeEvent<V>,V>
readOnly
- a boolean value specifying whether the component is put
read-only mode or notdefault boolean isReadOnly()
HasValue
HasValue
is in read-only mode or not.isReadOnly
in interface HasValue<E extends HasValue.ValueChangeEvent<V>,V>
false
if the user can modify the value, true
if
not.Copyright © 2020. All rights reserved.