|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectwicket.behavior.AbstractBehavior
wicket.behavior.AbstractAjaxBehavior
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 wicket.behavior.IBehaviorListener |
|---|
INTERFACE |
| Constructor Summary | |
|---|---|
AbstractDefaultAjaxBehavior()
|
|
| Method Summary | |
|---|---|
protected IAjaxCallDecorator |
getAjaxCallDecorator()
|
protected java.lang.CharSequence |
getCallbackScript()
|
protected java.lang.CharSequence |
getCallbackScript(boolean recordPageVersion,
boolean onlyTargetActivePage)
|
protected java.lang.CharSequence |
getCallbackScript(java.lang.CharSequence partialCall,
java.lang.CharSequence onSuccessScript,
java.lang.CharSequence onFailureScript)
Returns javascript that performs an ajax callback to this behavior. |
protected java.lang.String |
getImplementationId()
Gets the unique id of an ajax implementation. |
protected void |
onBind()
Subclasses should call super.onBind() |
protected void |
onRenderHeadInitContribution(Response response)
Do a one time (per page) header contribution that is the same for all ajax variant implementations (e.g. |
void |
onRequest()
Called when a request to a behavior is received. |
protected abstract void |
respond(AjaxRequestTarget target)
|
static java.lang.CharSequence |
throttleScript(java.lang.CharSequence script,
java.lang.String throttleId,
Duration throttleDelay)
Wraps the provided javascript with a throttled block. |
| Methods inherited from class wicket.behavior.AbstractAjaxBehavior |
|---|
bind, cleanup, getCallbackUrl, getCallbackUrl, getComponent, onComponentRendered, onComponentTag, onComponentTag, onRendered, onRenderHeadContribution, renderHead, writeJsReference, writeJsReference |
| Methods inherited from class wicket.behavior.AbstractBehavior |
|---|
detachModel, exception, onException, rendered |
| 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 java.lang.String getImplementationId()
AbstractAjaxBehavior
getImplementationId in class AbstractAjaxBehaviorAbstractAjaxBehavior.getImplementationId()protected void onBind()
onBind in class AbstractAjaxBehaviorAbstractAjaxBehavior.onBind()protected void onRenderHeadInitContribution(Response response)
AbstractAjaxBehavior
onRenderHeadInitContribution in class AbstractAjaxBehaviorresponse - head containerAbstractAjaxBehavior.onRenderHeadInitContribution(wicket.Response)protected IAjaxCallDecorator getAjaxCallDecorator()
protected java.lang.CharSequence getCallbackScript()
protected java.lang.CharSequence getCallbackScript(boolean recordPageVersion,
boolean onlyTargetActivePage)
recordPageVersion - if true the url will be encoded to execute on the current page
version, otherwise url will be encoded to execute on the
latest page versiononlyTargetActivePage - if true the callback to this behavior will be ignore if the
page is not the last one the user accessed
protected java.lang.CharSequence getCallbackScript(java.lang.CharSequence partialCall,
java.lang.CharSequence onSuccessScript,
java.lang.CharSequence onFailureScript)
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'onSuccessScript - javascript that will run when the ajax call finishes
successfullyonFailureScript - javascript that will run when the ajax call finishes with an
error status
public final void onRequest()
IBehaviorListener
IBehaviorListener.onRequest()protected abstract void respond(AjaxRequestTarget target)
target - The AJAX target
public static final java.lang.CharSequence throttleScript(java.lang.CharSequence script,
java.lang.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 | |||||||||