Class ThrottlingSettings

java.lang.Object
org.apache.wicket.ajax.attributes.ThrottlingSettings
All Implemented Interfaces:
Serializable, IClusterable

public class ThrottlingSettings extends Object implements IClusterable
Class to keep track of throttling settings.
Author:
ivaynberg
See Also:
  • Constructor Details

    • ThrottlingSettings

      Construct without id (will default to the component's markup ID) and postponeTimerOnUpdate set to false.
      Parameters:
      delay - throttle delay
    • ThrottlingSettings

      public ThrottlingSettings(Duration delay, boolean postponeTimerOnUpdate)
      Construct without id (will default to the component's markup ID).
      Parameters:
      delay - throttle delay
      postponeTimerOnUpdate - postpone timer
    • ThrottlingSettings

      public ThrottlingSettings(String id, Duration delay)
      Construct.
      Parameters:
      id - throttle id
      delay - throttle delay
    • ThrottlingSettings

      public ThrottlingSettings(String id, Duration delay, boolean postponeTimerOnUpdate)
      Construct.
      Parameters:
      id - throttle id
      delay - the amount of time the action should be postponed
  • Method Details

    • getDelay

      public Duration getDelay()
      Returns:
      the amount of time the action should be postponed
    • setDelay

      public void setDelay(Duration delay)
    • getId

      public String getId()
      This id is used by the client-side throttling code to keep track of the various event throttles. Normally you can just use any unique ID here, such as the component's markupId ( Component.getMarkupId()). To unite several different events with one throttle, give them the same ID. If this is null, it will (on the client only) default to the component's markupId.
      Returns:
      throttle id
    • getPostponeTimerOnUpdate

      public boolean getPostponeTimerOnUpdate()
      If it is set to true, then the timer is reset each time the throttle function gets called. Use this behaviour if you want something to happen at X milliseconds after the last call to throttle. If the parameter is not set, or set to false, then the timer is not reset.
    • setPostponeTimerOnUpdate

      public void setPostponeTimerOnUpdate(boolean postponeTimerOnUpdate)