public abstract class AbstractAjaxTimerBehavior extends AbstractDefaultAjaxBehavior
onTimer(AjaxRequestTarget)
,
restart(IPartialPageRequestHandler)
,
stop(IPartialPageRequestHandler)
,
Serialized FormINDICATOR
INTERFACE
Constructor and Description |
---|
AbstractAjaxTimerBehavior(Duration updateInterval)
Construct.
|
Modifier and Type | Method and Description |
---|---|
protected String |
getJsTimeoutCall(Duration updateInterval) |
Duration |
getUpdateInterval()
Returns the update interval
|
boolean |
isStopped() |
void |
onRemove(Component component)
Called to notify that the component is being removed from its parent
|
protected abstract void |
onTimer(AjaxRequestTarget target)
Listener method for the AJAX timer event.
|
protected void |
onUnbind()
Called when the behavior is removed from its component.
|
void |
renderHead(Component component,
IHeaderResponse response)
Render to the web response whatever the component wants to contribute to the head section.
|
protected void |
respond(AjaxRequestTarget target) |
void |
restart(IPartialPageRequestHandler target)
Re-enables the timer if already stopped
|
protected void |
setUpdateInterval(Duration updateInterval)
Sets the update interval duration.
|
protected boolean |
shouldTrigger()
Decides whether the timer behavior should render its JavaScript to re-trigger
it after the update interval.
|
void |
stop(IPartialPageRequestHandler target)
Stops the timer.
|
findIndicatorId, getAttributes, getCallbackFunction, getCallbackFunctionBody, getCallbackScript, getCallbackScript, onBind, onRequest, postprocessConfiguration, renderAjaxAttributes, renderAjaxAttributes, updateAjaxAttributes
afterRender, bind, getCallbackUrl, getComponent, onComponentRendered, onComponentTag, onComponentTag, unbind
beforeRender, canCallListenerInterface, detach, getStatelessHint, isEnabled, isTemporary, onConfigure, onEvent, onException
public AbstractAjaxTimerBehavior(Duration updateInterval)
updateInterval
- Duration between AJAX callbacksprotected final void setUpdateInterval(Duration updateInterval)
onTimer(AjaxRequestTarget)
method.updateInterval
- public final Duration getUpdateInterval()
public void renderHead(Component component, IHeaderResponse response)
Behavior
renderHead
in interface IComponentAwareHeaderContributor
renderHead
in class AbstractDefaultAjaxBehavior
component
- component which is contributing to the response. This parameter is here to give
the component as the context for component-awares implementing this interfaceresponse
- Response objectBehavior.renderHead(Component,
org.apache.wicket.markup.head.IHeaderResponse)
protected final String getJsTimeoutCall(Duration updateInterval)
updateInterval
- Duration between AJAX callbacksprotected final void respond(AjaxRequestTarget target)
respond
in class AbstractDefaultAjaxBehavior
target
- The AJAX targetAbstractDefaultAjaxBehavior.respond(AjaxRequestTarget)
protected boolean shouldTrigger()
true
if the behavior is not stopped, it is enabled and still attached to
any component in the page or to the page itselfprotected abstract void onTimer(AjaxRequestTarget target)
target
- The request targetpublic final boolean isStopped()
true
if has been stopped via stop(IPartialPageRequestHandler)
public final void restart(IPartialPageRequestHandler target)
target
- may be nullpublic final void stop(IPartialPageRequestHandler target)
target
- may be nullpublic void onRemove(Component component)
Behavior
protected void onUnbind()
AbstractAjaxBehavior
onUnbind
in class AbstractAjaxBehavior
Copyright © 2006–2016 Apache Software Foundation. All rights reserved.