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
,TextFieldBase
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:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Default value change timeout for textual inputs in milliseconds. -
Method Summary
Modifier and TypeMethodDescriptionGets current value change mode of the component.default int
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 Details
-
DEFAULT_CHANGE_TIMEOUT
static final int DEFAULT_CHANGE_TIMEOUTDefault value change timeout for textual inputs in milliseconds.- See Also:
-
-
Method Details
-
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
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
-