public interface IAjaxCallListener
Each method can return JavaScript that will be used as a body of a function that is executed
at the appropriate time. If the method returns null
or an empty string then it is ignored
and no function will be executed for this listener. Each JavaScript function receives arguments
in the exact order as specified in the method's javadoc.
Ajax call listeners are potential contributors to the page header by implementing
IComponentAwareHeaderContributor
. E.g. the JavaScript used
by the listener may depend on some JavaScript library, by implementing
IComponentAwareHeaderContributor
interface they can assure
it will be loaded.
Modifier and Type | Method and Description |
---|---|
default CharSequence |
getAfterHandler(Component component)
The JavaScript that will be executed after the Ajax call.
|
default CharSequence |
getBeforeHandler(Component component)
The JavaScript that will be executed before the Ajax call, as early as possible.
|
default CharSequence |
getBeforeSendHandler(Component component)
The JavaScript that will be executed right before the execution of the the Ajax call, only if all
preconditions pass.
|
default CharSequence |
getCompleteHandler(Component component)
The JavaScript that will be executed after both successful and unsuccessful return of the
Ajax call.
|
default CharSequence |
getDoneHandler(Component component)
The JavaScript that will be executed after the Ajax call is done, regardless whether it was
sent or not.
|
default CharSequence |
getFailureHandler(Component component)
The JavaScript that will be executed after unsuccessful return of the Ajax call.
|
default CharSequence |
getInitHandler(Component component)
The JavaScript that will be executed on initialization of the Ajax call, immediately after the causing event.
|
default CharSequence |
getPrecondition(Component component)
A JavaScript function that is invoked before the request is being executed.
|
default CharSequence |
getSuccessHandler(Component component)
The JavaScript that will be executed after successful return of the Ajax call.
|
default CharSequence getInitHandler(Component component)
component
- the Component with the Ajax behaviordefault CharSequence getBeforeHandler(Component component)
component
- the Component with the Ajax behaviordefault CharSequence getPrecondition(Component component)
false
then the execution of the Ajax call will be cancelled. The script will be
executed in a function that receives the following parameters:
component
- the Component with the Ajax behaviordefault CharSequence getBeforeSendHandler(Component component)
component
- the Component with the Ajax behaviordefault CharSequence getAfterHandler(Component component)
AjaxRequestAttributes.setAsynchronous(boolean)
) then this JavaScript will be executed
after the complete handler,
otherwise it is executed right after the execution of the Ajax request.component
- the Component with the Ajax behaviordefault CharSequence getSuccessHandler(Component component)
AjaxRequestAttributes.dataType
component
- the Component with the Ajax behaviordefault CharSequence getFailureHandler(Component component)
component
- the Component with the Ajax behaviordefault CharSequence getCompleteHandler(Component component)
component
- the Component with the Ajax behaviordefault CharSequence getDoneHandler(Component component)
component
- the Component with the Ajax behaviorCopyright © 2006–2022 Apache Software Foundation. All rights reserved.