Class ThrottlingSettings
java.lang.Object
org.apache.wicket.ajax.attributes.ThrottlingSettings
- All Implemented Interfaces:
Serializable
,IClusterable
Class to keep track of throttling settings.
- Author:
- ivaynberg
- See Also:
-
Constructor Summary
ConstructorDescriptionThrottlingSettings
(String id, Duration delay) Construct.ThrottlingSettings
(String id, Duration delay, boolean postponeTimerOnUpdate) Construct.ThrottlingSettings
(Duration delay) Construct without id (will default to the component's markup ID) and postponeTimerOnUpdate set to false.ThrottlingSettings
(Duration delay, boolean postponeTimerOnUpdate) Construct without id (will default to the component's markup ID). -
Method Summary
Modifier and TypeMethodDescriptiongetDelay()
getId()
This id is used by the client-side throttling code to keep track of the various event throttles.boolean
If it is set to true, then the timer is reset each time the throttle function gets called.void
void
setPostponeTimerOnUpdate
(boolean postponeTimerOnUpdate)
-
Constructor Details
-
ThrottlingSettings
Construct without id (will default to the component's markup ID) and postponeTimerOnUpdate set to false.- Parameters:
delay
- throttle delay
-
ThrottlingSettings
Construct without id (will default to the component's markup ID).- Parameters:
delay
- throttle delaypostponeTimerOnUpdate
- postpone timer
-
ThrottlingSettings
Construct.- Parameters:
id
- throttle iddelay
- throttle delay
-
ThrottlingSettings
Construct.- Parameters:
id
- throttle iddelay
- the amount of time the action should be postponed
-
-
Method Details
-
getDelay
- Returns:
- the amount of time the action should be postponed
-
setDelay
-
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
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
-