org.apache.wicket.ajax.calldecorator
Class AjaxCallThrottlingDecorator
java.lang.Object
org.apache.wicket.ajax.calldecorator.AjaxPostprocessingCallDecorator
org.apache.wicket.ajax.calldecorator.AjaxCallThrottlingDecorator
- All Implemented Interfaces:
- Serializable, IAjaxCallDecorator, IClusterable
public final class AjaxCallThrottlingDecorator
- extends AjaxPostprocessingCallDecorator
Adds throttling to the ajax call. Throttled behaviors only execute once within the given delay
even though they can be triggered multiple times.
For example, this is useful when attaching an event behavior to the onkeypress event. It is not
desirable to have an ajax call made every time the user types so we can throttle that call to a
desirable delay, such as once per second. This gives us a near real time ability to provide
feedback without overloading the server.
- Since:
- 1.2
- Author:
- Igor Vaynberg (ivaynberg)
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AjaxCallThrottlingDecorator
public AjaxCallThrottlingDecorator(String id,
Duration delay)
- Construct.
- Parameters:
id
- throttle iddelay
- throttle delay
AjaxCallThrottlingDecorator
public AjaxCallThrottlingDecorator(IAjaxCallDecorator decorator,
String id,
Duration delay)
- Construct.
- Parameters:
decorator
- wrapped decoratorid
- throttle iddelay
- throttle delay
postDecorateScript
public final CharSequence postDecorateScript(Component c,
CharSequence script)
- Description copied from class:
AjaxPostprocessingCallDecorator
- Decorates ajax call script
- Overrides:
postDecorateScript
in class AjaxPostprocessingCallDecorator
- Returns:
- decorated script
- See Also:
org.apache.wicket.ajax.calldecorator.AjaxPostprocessingCallDecorator#postDecorateScript(CharSequence)
Copyright © 2004-2010 Apache Software Foundation. All Rights Reserved.