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:
Serializable
,IComponentAwareEventSink
,IRequestListener
,IComponentAwareHeaderContributor
,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(Duration updateInterval)
Construct.AjaxSelfUpdatingTimerBehavior(Duration updateInterval)
Deprecated.Since Wicket 9 this constructor is deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
onPostProcessTarget(AjaxRequestTarget target)
Give the subclass a chance to add something to the target, like a javascript effect call.static AjaxSelfUpdatingTimerBehavior
onSelfUpdate(Duration interval, org.danekja.java.util.function.serializable.SerializableConsumer<AjaxRequestTarget> onTimer)
Creates anAbstractAjaxTimerBehavior
based on lambda expressionsprotected void
onTimer(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, onMethodMismatch, 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
-
-
-
-
Constructor Detail
-
AjaxSelfUpdatingTimerBehavior
@Deprecated public AjaxSelfUpdatingTimerBehavior(Duration updateInterval)
Deprecated.Since Wicket 9 this constructor is deprecated. It will be removed in Wicket 10. UseAjaxSelfUpdatingTimerBehavior(Duration)
insteadConstruct.- Parameters:
updateInterval
-Duration
between AJAX callbacks
-
AjaxSelfUpdatingTimerBehavior
public AjaxSelfUpdatingTimerBehavior(Duration updateInterval)
Construct.- Parameters:
updateInterval
-Duration
between AJAX callbacks
-
-
Method Detail
-
onTimer
protected final void onTimer(AjaxRequestTarget target)
Description copied from class:AbstractAjaxTimerBehavior
Listener method for the AJAX timer event.- Specified by:
onTimer
in classAbstractAjaxTimerBehavior
- Parameters:
target
- The request target
-
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(Duration interval, org.danekja.java.util.function.serializable.SerializableConsumer<AjaxRequestTarget> onTimer)
Creates anAbstractAjaxTimerBehavior
based on lambda expressions- Parameters:
interval
- the interval for the self updateonTimer
- theSerializableConsumer
which accepts theAjaxRequestTarget
- Returns:
- the
AbstractAjaxTimerBehavior
-
-