Package com.vaadin.flow.data.value
Interface HasValueChangeMode
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
AbstractNumberField
,BigDecimalField
,EmailField
,Input
,IntegerField
,NumberField
,PasswordField
,RichTextEditor
,TextArea
,TextField
public interface HasValueChangeMode extends Serializable
Denotes that the component is able to change the way its value on the client side is synchronized with the server side.A class implementing this interface should typically also implement
HasValue
even though this is not required on the API level.- Since:
- 1.0.
- Author:
- Vaadin Ltd
- See Also:
AbstractSinglePropertyField.setSynchronizedEvent(String)
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_CHANGE_TIMEOUT
Default value change timeout for textual inputs in milliseconds.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description ValueChangeMode
getValueChangeMode()
Gets current value change mode of the component.default int
getValueChangeTimeout()
Returns the currently set timeout, for how oftenHasValue.ValueChangeEvent
s are triggered when the ValueChangeMode is set toValueChangeMode.LAZY
, orValueChangeMode.TIMEOUT
.void
setValueChangeMode(ValueChangeMode valueChangeMode)
Sets new value change mode for the component.default void
setValueChangeTimeout(int valueChangeTimeout)
Sets how oftenHasValue.ValueChangeEvent
s are triggered when the ValueChangeMode is set toValueChangeMode.LAZY
, orValueChangeMode.TIMEOUT
.
-
-
-
Field Detail
-
DEFAULT_CHANGE_TIMEOUT
static final int DEFAULT_CHANGE_TIMEOUT
Default value change timeout for textual inputs in milliseconds.- See Also:
- Constant Field Values
-
-
Method Detail
-
getValueChangeMode
ValueChangeMode getValueChangeMode()
Gets current value change mode of the component.- Returns:
- current value change mode of the component, or
null
if the value is not synchronized
-
setValueChangeMode
void setValueChangeMode(ValueChangeMode valueChangeMode)
Sets new value change mode for the component.- Parameters:
valueChangeMode
- new value change mode, ornull
to disable the value synchronization
-
setValueChangeTimeout
default void setValueChangeTimeout(int valueChangeTimeout)
Sets how oftenHasValue.ValueChangeEvent
s are triggered when the ValueChangeMode is set toValueChangeMode.LAZY
, orValueChangeMode.TIMEOUT
.Implementations should use
ValueChangeMode.applyChangeTimeout(ValueChangeMode, int, DomListenerRegistration)
.- Parameters:
valueChangeTimeout
- the timeout in milliseconds of how oftenHasValue.ValueChangeEvent
s are triggered.- Throws:
UnsupportedOperationException
- if neitherValueChangeMode.LAZY
, norValueChangeMode.TIMEOUT
is supported
-
getValueChangeTimeout
default int getValueChangeTimeout()
Returns the currently set timeout, for how oftenHasValue.ValueChangeEvent
s are triggered when the ValueChangeMode is set toValueChangeMode.LAZY
, orValueChangeMode.TIMEOUT
.- Returns:
- the timeout in milliseconds of how often
HasValue.ValueChangeEvent
s are triggered. - Throws:
UnsupportedOperationException
- if neitherValueChangeMode.LAZY
, norValueChangeMode.TIMEOUT
is supported
-
-