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
Automatically re-renders the component it is attached to via AJAX at a regular interval.
- Since:
- 1.2
- Author:
- Igor Vaynberg (ivaynberg)
- See Also:
-
Field Summary
Fields inherited from class org.apache.wicket.ajax.AbstractDefaultAjaxBehavior
INDICATOR
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
onPostProcessTarget
(AjaxRequestTarget target) Give the subclass a chance to add something to the target, like a javascript effect call.onSelfUpdate
(Duration interval, org.danekja.java.util.function.serializable.SerializableConsumer<AjaxRequestTarget> onTimer) Creates anAbstractAjaxTimerBehavior
based on lambda expressionsprotected final 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 Details
-
AjaxSelfUpdatingTimerBehavior
Construct.- Parameters:
updateInterval
-Duration
between AJAX callbacks
-
-
Method Details
-
onTimer
Description copied from class:AbstractAjaxTimerBehavior
Listener method for the AJAX timer event.- Specified by:
onTimer
in classAbstractAjaxTimerBehavior
- Parameters:
target
- The request target
-
onPostProcessTarget
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
-