Package com.vaadin.flow.component.shared
Enum Class DisableOnClickMode
- All Implemented Interfaces:
Serializable,Comparable<DisableOnClickMode>,Constable
Defines how long a component stays disabled after it has been disabled on
click.
- Since:
- 25.4
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe component stays disabled until it is enabled again by the application, for example by callingsetEnabled(true)from a click listener.The component is enabled again automatically with the next response the server sends to the client after the click. -
Method Summary
Modifier and TypeMethodDescriptionstatic DisableOnClickModeReturns the enum constant of this class with the specified name.static DisableOnClickMode[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
UNTIL_ENABLED
The component stays disabled until it is enabled again by the application, for example by callingsetEnabled(true)from a click listener. This is the default mode. -
UNTIL_RESPONSE
The component is enabled again automatically with the next response the server sends to the client after the click. Normally this is the response to the request that delivered the click, so the component stays disabled while the click listeners run and is enabled again once they are done. This prevents accidental extra clicks while the server processes the click, without requiring you to enable the component again from a click listener. If the component is detached before that response, it is enabled again when it is attached the next time.If push is enabled and a click listener calls
UI.push()while it is still running, that push is the next response and enables the component before the listener has finished. UseUNTIL_ENABLEDwhen the component must stay disabled in that case.If the component's enabled state is explicitly set while the click is handled, for example by calling
setEnabled(false)from a click listener, the automatic enabling is skipped for that click.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException- if the argument is null
-