com.vaadin.flow.data.value.
Enum ValueChangeMode
- java.lang.Object
-
- java.lang.Enum<ValueChangeMode>
-
- com.vaadin.flow.data.value.ValueChangeMode
-
All Implemented Interfaces:
public enum ValueChangeMode extends Enum<ValueChangeMode>
All possible value change modes that can be set for any component extending
HasValueChangeMode
. Depending on the mode used, the component'svalue
is synced differently from the client to the server.Since:
1.0.
Author:
Vaadin Ltd
-
-
Enum Constant Summary
Enum Constants Enum Constant and Description EAGER
Syncs the value to the server each time it's changed on the client.
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.
-
Method Summary
All Methods Modifier and Type Method and Description static String
eventForMode(ValueChangeMode mode, String eagerEventName)
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.
-
-
-
Enum Constant Detail
-
EAGER
public static final ValueChangeMode EAGER
Syncs the value to the server each time it's changed on the client. The event that triggers the synchronization is defined by the component.
-
ON_BLUR
public static final ValueChangeMode ON_BLUR
Syncs the value to the server on
blur
event, i.e. when the component looses focus.See Also:
-
ON_CHANGE
public static final ValueChangeMode ON_CHANGE
Syncs the value to the server on
change
event, i.e. when the component value is committed.See Also:
-
-
Method Detail
-
values
public static ValueChangeMode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (ValueChangeMode c : ValueChangeMode.values()) System.out.println(c);
Returns:
an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ValueChangeMode valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
Parameters:
name
- the name of the enum constant to be returned.Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
eventForMode
public static String eventForMode(ValueChangeMode mode, String eagerEventName)
Gets the name of the event associated with the given mode. If the mode is
null
, then null is returned. If the mode isEAGER
, then the provided eager event name is returned.Parameters:
mode
- the value change modeeagerEventName
- the event name to use for the eager modeReturns:
the event name
See Also:
HasValueChangeMode.setValueChangeMode(ValueChangeMode)
,AbstractSinglePropertyField.setSynchronizedEvent(String)
-
-