Package org.apache.wicket.ajax
Class AjaxSelfUpdatingTimerBehavior
- java.lang.Object
-
- org.apache.wicket.behavior.Behavior
-
- org.apache.wicket.behavior.AbstractAjaxBehavior
-
- org.apache.wicket.ajax.AbstractDefaultAjaxBehavior
-
- org.apache.wicket.ajax.AbstractAjaxTimerBehavior
-
- org.apache.wicket.ajax.AjaxSelfUpdatingTimerBehavior
-
- All Implemented Interfaces:
java.io.Serializable,IComponentAwareEventSink,IRequestListener,IComponentAwareHeaderContributor,org.apache.wicket.util.io.IClusterable
public class AjaxSelfUpdatingTimerBehavior extends AbstractAjaxTimerBehavior
Automatically re-renders the component it is attached to via AJAX at a regular interval.- Since:
- 1.2
- Author:
- Igor Vaynberg (ivaynberg)
- See Also:
onTimer(AjaxRequestTarget),onPostProcessTarget(AjaxRequestTarget), Serialized Form
-
-
Field Summary
-
Fields inherited from class org.apache.wicket.ajax.AbstractDefaultAjaxBehavior
INDICATOR
-
-
Constructor Summary
Constructors Constructor Description AjaxSelfUpdatingTimerBehavior(org.apache.wicket.util.time.Duration updateInterval)Construct.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidonPostProcessTarget(AjaxRequestTarget target)Give the subclass a chance to add something to the target, like a javascript effect call.static AjaxSelfUpdatingTimerBehavioronSelfUpdate(org.apache.wicket.util.time.Duration interval, org.danekja.java.util.function.serializable.SerializableConsumer<AjaxRequestTarget> onTimer)Creates anAbstractAjaxTimerBehaviorbased on lambda expressionsprotected voidonTimer(AjaxRequestTarget target)Listener method for the AJAX timer event.-
Methods inherited from class org.apache.wicket.ajax.AbstractAjaxTimerBehavior
getTimerId, getUpdateInterval, isStopped, onRemove, onTimer, onUnbind, renderHead, respond, restart, setUpdateInterval, shouldTrigger, stop
-
Methods inherited from class org.apache.wicket.ajax.AbstractDefaultAjaxBehavior
findIndicatorId, getAttributes, getCallbackFunction, getCallbackFunctionBody, getCallbackScript, getCallbackScript, onBind, onRequest, postprocessConfiguration, renderAjaxAttributes, renderAjaxAttributes, updateAjaxAttributes
-
Methods inherited from class org.apache.wicket.behavior.AbstractAjaxBehavior
afterRender, bind, getCallbackUrl, getComponent, onComponentRendered, onComponentTag, onComponentTag, unbind
-
Methods inherited from class org.apache.wicket.behavior.Behavior
beforeRender, canCallListener, detach, getStatelessHint, isEnabled, isTemporary, onAttribute, onConfigure, onEvent, onException, onTag
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.wicket.IRequestListener
rendersPage
-
-
-
-
Method Detail
-
onTimer
protected final void onTimer(AjaxRequestTarget target)
Description copied from class:AbstractAjaxTimerBehaviorListener method for the AJAX timer event.- Specified by:
onTimerin classAbstractAjaxTimerBehavior- Parameters:
target- The request target- See Also:
AbstractAjaxTimerBehavior.onTimer(AjaxRequestTarget)
-
onPostProcessTarget
protected void onPostProcessTarget(AjaxRequestTarget target)
Give the subclass a chance to add something to the target, like a javascript effect call. Called after the hosting component has been added to the target.- Parameters:
target- The AJAX target
-
onSelfUpdate
public static AjaxSelfUpdatingTimerBehavior onSelfUpdate(org.apache.wicket.util.time.Duration interval, org.danekja.java.util.function.serializable.SerializableConsumer<AjaxRequestTarget> onTimer)
Creates anAbstractAjaxTimerBehaviorbased on lambda expressions- Parameters:
interval- the interval for the self updateonTimer- theSerializableConsumerwhich accepts theAjaxRequestTarget- Returns:
- the
AbstractAjaxTimerBehavior
-
-