public enum ValueChangeMode extends Enum<ValueChangeMode>
HasValueChangeMode. Depending on the mode used, the component's
value is synced differently from the client to the server.| Enum Constant and Description |
|---|
EAGER
Syncs the value to the server each time it's changed on the client.
|
LAZY
On every user event, schedule a synchronization after a defined interval,
cancelling the currently-scheduled event if any.
|
ON_BLUR
Syncs the value to the server on
blur event, i.e. |
ON_CHANGE
Syncs the value to the server on
change event, i.e. |
TIMEOUT
Syncs the value at defined intervals as long as the value changes from
one event to the next.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
applyChangeTimeout(ValueChangeMode mode,
int timeout,
DomListenerRegistration registration)
Applies the value change timeout of the given mode on the registration of
the DOM event listener that synchronizes.
|
static String |
eventForMode(ValueChangeMode mode,
String immediateEventName)
Gets the name of the event associated with the given mode.
|
static ValueChangeMode |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ValueChangeMode[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ValueChangeMode EAGER
public static final ValueChangeMode LAZY
The recommended default timeout for input fields is
HasValueChangeMode.DEFAULT_CHANGE_TIMEOUT.
public static final ValueChangeMode TIMEOUT
public static final ValueChangeMode ON_BLUR
blur event, i.e. when the
component looses focus.public static final ValueChangeMode ON_CHANGE
change event, i.e. when the
component value is committed.public static ValueChangeMode[] values()
for (ValueChangeMode c : ValueChangeMode.values()) System.out.println(c);
public static ValueChangeMode valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static String eventForMode(ValueChangeMode mode, String immediateEventName)
null, then null is returned. If the mode is EAGER,
LAZY, or TIMEOUT, then the provided immediate event
name is returned.mode - the value change modeimmediateEventName - the name of the event that is fired immediately on value
changeHasValueChangeMode.setValueChangeMode(ValueChangeMode),
AbstractSinglePropertyField.setSynchronizedEvent(String)public static void applyChangeTimeout(ValueChangeMode mode, int timeout, DomListenerRegistration registration)
LAZY, or TIMEOUT.mode - the value change modetimeout - Value change timeout in milliseconds. 0 means
timeout is disabled, so the change mode will behave like
EAGERregistration - The registration of the DOM event listener that synchronizes.HasValueChangeMode.getValueChangeTimeout(),
AbstractSinglePropertyField.getSynchronizationRegistration()Copyright © 2025. All rights reserved.