public class AjaxCallListener extends Object implements IAjaxCallListener, IComponentAwareHeaderContributor
| Constructor and Description |
|---|
AjaxCallListener() |
| Modifier and Type | Method and Description |
|---|---|
CharSequence |
getAfterHandler(Component component)
The JavaScript that will be executed after the Ajax call.
|
CharSequence |
getBeforeHandler(Component component)
The JavaScript that will be executed before the Ajax call, as early as possible.
|
CharSequence |
getBeforeSendHandler(Component component)
The JavaScript that will be executed right before the execution of the the Ajax call, only if all
preconditions pass.
|
CharSequence |
getCompleteHandler(Component component)
The JavaScript that will be executed after both successful and unsuccessful return of the
Ajax call.
|
CharSequence |
getDoneHandler(Component component)
The JavaScript that will be executed after the Ajax call is done, regardless whether it was
sent or not.
|
CharSequence |
getFailureHandler(Component component)
The JavaScript that will be executed after unsuccessful return of the Ajax call.
|
CharSequence |
getInitHandler(Component component)
The JavaScript that will be executed on initialization of the Ajax call, immediately after the causing event.
|
CharSequence |
getPrecondition(Component component)
A JavaScript function that is invoked before the request is being executed.
|
CharSequence |
getSuccessHandler(Component component)
The JavaScript that will be executed after successful return of the Ajax call.
|
AjaxCallListener |
onAfter(CharSequence after)
Sets the JavaScript code that will be returned by
getAfterHandler(Component). |
AjaxCallListener |
onBefore(CharSequence before)
Sets the JavaScript code that will be returned by
getBeforeHandler(Component). |
AjaxCallListener |
onBeforeSend(CharSequence beforeSend)
Sets the JavaScript code that will be returned by
getBeforeSendHandler(Component). |
AjaxCallListener |
onComplete(CharSequence complete)
Sets the JavaScript code that will be returned by
getCompleteHandler(Component). |
AjaxCallListener |
onDone(CharSequence done)
Sets the JavaScript code that will be returned by
getDoneHandler(Component). |
AjaxCallListener |
onFailure(CharSequence failure)
Sets the JavaScript code that will be returned by
getFailureHandler(Component). |
AjaxCallListener |
onInit(CharSequence init)
Sets the JavaScript code that will be returned by
getInitHandler(Component). |
AjaxCallListener |
onPrecondition(CharSequence precondition)
Sets the JavaScript code that will be returned by
getPrecondition(Component). |
AjaxCallListener |
onSuccess(CharSequence success)
Sets the JavaScript code that will be returned by
getSuccessHandler(Component). |
void |
renderHead(Component component,
IHeaderResponse response)
Render to the web response whatever the component-aware wants to contribute to the head
section.
|
public AjaxCallListener onInit(CharSequence init)
getInitHandler(Component).
If this code was already set, the new one will be appended to the existing one.init - the JavaScript code for the corresponding handlerpublic AjaxCallListener onDone(CharSequence done)
getDoneHandler(Component).
If this code was already set, the new one will be appended to the existing one.init - the JavaScript code for the corresponding handlerpublic AjaxCallListener onBefore(CharSequence before)
getBeforeHandler(Component).
If this code was already set, the new one will be appended to the existing one.before - the JavaScript code for the corresponding handlerpublic AjaxCallListener onBeforeSend(CharSequence beforeSend)
getBeforeSendHandler(Component).
If this code was already set, the new one will be appended to the existing one.beforeSend - the JavaScript code for the corresponding handlerpublic AjaxCallListener onAfter(CharSequence after)
getAfterHandler(Component).
If this code was already set, the new one will be appended to the existing one.after - the JavaScript code for the corresponding handlerpublic AjaxCallListener onSuccess(CharSequence success)
getSuccessHandler(Component).
If this code was already set, the new one will be appended to the existing one.success - the JavaScript code for the corresponding handlerpublic AjaxCallListener onFailure(CharSequence failure)
getFailureHandler(Component).
If this code was already set, the new one will be appended to the existing one.failure - the JavaScript code for the corresponding handlerpublic AjaxCallListener onComplete(CharSequence complete)
getCompleteHandler(Component).
If this code was already set, the new one will be appended to the existing one.complete - the JavaScript code for the corresponding handlerpublic AjaxCallListener onPrecondition(CharSequence precondition)
getPrecondition(Component).
If this code was already set, the new one will be appended to the existing one.precondition - the JavaScript code for the preconditionpublic CharSequence getSuccessHandler(Component component)
IAjaxCallListenerAjaxRequestAttributes.dataTypegetSuccessHandler in interface IAjaxCallListenercomponent - the Component with the Ajax behaviorpublic CharSequence getFailureHandler(Component component)
IAjaxCallListenergetFailureHandler in interface IAjaxCallListenercomponent - the Component with the Ajax behaviorpublic CharSequence getInitHandler(Component component)
IAjaxCallListenergetInitHandler in interface IAjaxCallListenercomponent - the Component with the Ajax behaviorpublic CharSequence getBeforeHandler(Component component)
IAjaxCallListenergetBeforeHandler in interface IAjaxCallListenercomponent - the Component with the Ajax behaviorpublic CharSequence getBeforeSendHandler(Component component)
IAjaxCallListenergetBeforeSendHandler in interface IAjaxCallListenercomponent - the Component with the Ajax behaviorpublic CharSequence getAfterHandler(Component component)
IAjaxCallListenerAjaxRequestAttributes.setAsynchronous(boolean)) then this JavaScript will be executed
after the complete handler,
otherwise it is executed right after the execution of the Ajax request.getAfterHandler in interface IAjaxCallListenercomponent - the Component with the Ajax behaviorpublic CharSequence getCompleteHandler(Component component)
IAjaxCallListenergetCompleteHandler in interface IAjaxCallListenercomponent - the Component with the Ajax behaviorpublic CharSequence getPrecondition(Component component)
IAjaxCallListenerfalse then the execution of the Ajax call will be cancelled. The script will be
executed in a function that receives the following parameters:
getPrecondition in interface IAjaxCallListenercomponent - the Component with the Ajax behaviorpublic CharSequence getDoneHandler(Component component)
IAjaxCallListenergetDoneHandler in interface IAjaxCallListenercomponent - the Component with the Ajax behaviorpublic void renderHead(Component component, IHeaderResponse response)
IComponentAwareHeaderContributorrenderHead in interface IComponentAwareHeaderContributorcomponent - 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 objectCopyright © 2006–2021 Apache Software Foundation. All rights reserved.