|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.wicket.behavior.Behavior org.apache.wicket.behavior.AbstractAjaxBehavior org.apache.wicket.ajax.AbstractDefaultAjaxBehavior
public abstract class AbstractDefaultAjaxBehavior
The base class for Wicket's default AJAX implementation.
Field Summary | |
---|---|
static ResourceReference |
INDICATOR
reference to the default indicator gif file. |
Fields inherited from interface org.apache.wicket.behavior.IBehaviorListener |
---|
INTERFACE |
Constructor Summary | |
---|---|
AbstractDefaultAjaxBehavior()
|
Method Summary | |
---|---|
protected String |
findIndicatorId()
Finds the markup id of the indicator. |
protected CharSequence |
generateCallbackScript(CharSequence partialCall)
Returns javascript that performs an ajax callback to this behavior. |
protected IAjaxCallDecorator |
getAjaxCallDecorator()
|
protected CharSequence |
getCallbackScript()
|
protected AjaxChannel |
getChannel()
Provides an AjaxChannel for this Behavior. |
protected String |
getChannelName()
Deprecated. Use getChannel() instead |
protected CharSequence |
getFailureScript()
|
protected CharSequence |
getPreconditionScript()
|
protected CharSequence |
getSuccessScript()
|
protected void |
onBind()
Subclasses should call super.onBind() |
void |
onRequest()
Called when a request to a behavior is received. |
void |
renderHead(Component component,
IHeaderResponse response)
Render to the web response whatever the component wants to contribute to the head section. |
protected abstract void |
respond(AjaxRequestTarget target)
|
static CharSequence |
throttleScript(CharSequence script,
String throttleId,
Duration throttleDelay)
Wraps the provided javascript with a throttled block. |
Methods inherited from class org.apache.wicket.behavior.AbstractAjaxBehavior |
---|
afterRender, bind, getCallbackUrl, getComponent, getStatelessHint, onComponentRendered, onComponentTag, onComponentTag |
Methods inherited from class org.apache.wicket.behavior.Behavior |
---|
beforeRender, canCallListenerInterface, canCallListenerInterface, detach, isEnabled, isTemporary, onConfigure, onEvent, onException, unbind |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final ResourceReference INDICATOR
Constructor Detail |
---|
public AbstractDefaultAjaxBehavior()
Method Detail |
---|
protected void onBind()
onBind
in class AbstractAjaxBehavior
AbstractAjaxBehavior.onBind()
public void renderHead(Component component, IHeaderResponse response)
Behavior
renderHead
in interface IComponentAwareHeaderContributor
renderHead
in class Behavior
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.html.IHeaderResponse)
protected IAjaxCallDecorator getAjaxCallDecorator()
protected CharSequence getCallbackScript()
protected CharSequence getPreconditionScript()
protected CharSequence getFailureScript()
protected CharSequence getSuccessScript()
protected CharSequence generateCallbackScript(CharSequence partialCall)
getAjaxCallDecorator()
.
partialCall
- JavaScript of a partial call to the function performing the actual ajax callback.
Must be in format function(params,
with signature
function(params, onSuccessHandler, onFailureHandler
. Example:
wicketAjaxGet('callbackurl'
@Deprecated protected String getChannelName()
getChannel()
instead
protected AjaxChannel getChannel()
protected String findIndicatorId()
null
if no indicator foundpublic final void onRequest()
IBehaviorListener
IBehaviorListener.onRequest()
protected abstract void respond(AjaxRequestTarget target)
target
- The AJAX targetpublic static CharSequence throttleScript(CharSequence script, String throttleId, Duration throttleDelay)
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 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 with ajax calls.
script
- javascript to be throttledthrottleId
- the id of the throttle to be used. Usually this should remain constant for the
same javascript block.throttleDelay
- time span within which the javascript block will only execute once
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |