Enum Class DisableOnClickMode

java.lang.Object
java.lang.Enum<DisableOnClickMode>
com.vaadin.flow.component.shared.DisableOnClickMode
All Implemented Interfaces:
Serializable, Comparable<DisableOnClickMode>, Constable

public enum DisableOnClickMode extends Enum<DisableOnClickMode>
Defines how long a component stays disabled after it has been disabled on click.
Since:
25.4
  • Enum Constant Details

    • UNTIL_ENABLED

      public static final DisableOnClickMode UNTIL_ENABLED
      The component stays disabled until it is enabled again by the application, for example by calling setEnabled(true) from a click listener. This is the default mode.
    • UNTIL_RESPONSE

      public static final DisableOnClickMode 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. Use UNTIL_ENABLED when 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

      public static DisableOnClickMode[] 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

      public static DisableOnClickMode valueOf(String name)
      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 name
      NullPointerException - if the argument is null