|
||||||||||
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 AjaxRequestAttributes |
getAttributes()
|
CharSequence |
getCallbackFunction(CallbackParameter... extraParameters)
Generates a javascript function that can take parameters and performs an AJAX call which includes these parameters. |
CharSequence |
getCallbackFunctionBody(CallbackParameter... extraParameters)
Generates the body the callback function. |
CharSequence |
getCallbackScript()
|
protected CharSequence |
getCallbackScript(Component component)
|
protected AjaxChannel |
getChannel()
Deprecated. Use AjaxRequestAttributes |
protected CharSequence |
getFailureScript()
Deprecated. |
protected CharSequence |
getPreconditionScript()
Deprecated. Use AjaxRequestAttributes |
protected CharSequence |
getSuccessScript()
Deprecated. |
protected void |
onBind()
Subclasses should call super.onBind() |
void |
onRequest()
Called when a request to a behavior is received. |
protected void |
postprocessConfiguration(JSONObject attributesJson,
Component component)
Gives a chance to modify the JSON attributesJson that is going to be used as attributes for the Ajax call. |
protected CharSequence |
renderAjaxAttributes(Component component)
{ u: 'editable-label?6-1.IBehaviorListener.0-text1-label', // url m: 'POST', // method name. |
protected CharSequence |
renderAjaxAttributes(Component component,
AjaxRequestAttributes attributes)
|
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)
|
protected void |
updateAjaxAttributes(AjaxRequestAttributes attributes)
Gives a chance to the specializations to modify the attributes. |
Methods inherited from class org.apache.wicket.behavior.AbstractAjaxBehavior |
---|
afterRender, bind, getCallbackUrl, getComponent, onComponentRendered, onComponentTag, onComponentTag, onUnbind, unbind |
Methods inherited from class org.apache.wicket.behavior.Behavior |
---|
beforeRender, canCallListenerInterface, detach, getStatelessHint, isEnabled, isTemporary, onConfigure, onEvent, onException, onRemove |
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.head.IHeaderResponse)
protected final AjaxRequestAttributes getAttributes()
protected void updateAjaxAttributes(AjaxRequestAttributes attributes)
attributes
- protected final CharSequence renderAjaxAttributes(Component component)
{ u: 'editable-label?6-1.IBehaviorListener.0-text1-label', // url m: 'POST', // method name. Default: 'GET' c: 'label7', // component id (String) or window for page e: 'click', // event name sh: [], // list of success handlers fh: [], // list of failure handlers pre: [], // list of preconditions. If empty set default : Wicket.$(settings{c}) !== null ep: {}, // extra parameters async: true|false, // asynchronous XHR or not ch: 'someName|d', // AjaxChannel i: 'indicatorId', // indicator component id ad: true, // allow default }
component
- the component with that behavior
protected final CharSequence renderAjaxAttributes(Component component, AjaxRequestAttributes attributes)
component
- attributes
-
protected void postprocessConfiguration(JSONObject attributesJson, Component component) throws JSONException
attributesJson
- the JSON object created by #renderAjaxAttributes()component
- the component with the attached Ajax behavior
JSONException
- thrown if an error occurs while modifying attributesJson argumentpublic CharSequence getCallbackScript()
protected CharSequence getCallbackScript(Component component)
component
- the component to use when generating the attributes
public CharSequence getCallbackFunction(CallbackParameter... extraParameters)
function(param1, param2) { var attrs = attrsJson; var params = {'param1': param1, 'param2': param2}; attrs.ep = jQuery.extend(attrs.ep, params); Wicket.Ajax.ajax(attrs); }
extraParameters
-
public CharSequence getCallbackFunctionBody(CallbackParameter... extraParameters)
extraParameters
-
@Deprecated protected CharSequence getPreconditionScript()
AjaxRequestAttributes
@Deprecated protected CharSequence getFailureScript()
@Deprecated protected CharSequence getSuccessScript()
@Deprecated protected AjaxChannel getChannel()
AjaxRequestAttributes
protected String findIndicatorId()
null
if no indicator foundpublic final void onRequest()
IBehaviorListener
IBehaviorListener.onRequest()
protected abstract void respond(AjaxRequestTarget target)
target
- The AJAX target
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |