public abstract class AbstractYuiAjaxBehavior
extends org.apache.wicket.ajax.AbstractDefaultAjaxBehavior
AbstractDefaultAjaxBehavior
s that want to use YUI modules. It uses a IYuiContext
to
register all required components. The IYuiContext
is created by a (global) IYuiManager
which, in this
case, lives inside the Page
(as an Behavior
) that is retrieved by component.getPage()
To allow clientside javascript components to do callbacks in a more flexible way than, for example, just sticking
them inside an element's onclick attribute, this behavior uses a bean that implements IAjaxSettings
in which
it will store the callbackUrl, a list of allowed callbackParameters and an anonymous function that takes the
callbackUrl as an argument and executes the callbackScript that is generated by the AbstractDefaultAjaxBehavior
.
Subclasses should override addHeaderContribution(IYuiContext context)
to get access to the
IYuiContext
.
Note: This behavior skips adding the necessary Wicket-Ajax header contributions, as this is handled by the
YuiHeaderCache
Constructor and Description |
---|
AbstractYuiAjaxBehavior(IAjaxSettings settings) |
Modifier and Type | Method and Description |
---|---|
void |
addHeaderContribution(IYuiContext context)
Override this method to get access to the IYuiContext
|
protected void |
onRenderHead(org.apache.wicket.markup.head.IHeaderResponse response) |
void |
renderHead(org.apache.wicket.Component component,
org.apache.wicket.markup.head.IHeaderResponse response)
Don't call super since WicketAjax is loaded by Yui webapp behavior
TODO: webapp ajax is configurable, maybe check here and still load it.
|
protected void |
updateAjaxAttributes(org.apache.wicket.ajax.attributes.AjaxRequestAttributes attributes) |
protected void |
updateAjaxSettings() |
findIndicatorId, getAttributes, getCallbackFunction, getCallbackFunctionBody, getCallbackScript, getCallbackScript, getChannel, getFailureScript, getPreconditionScript, getSuccessScript, onBind, onRequest, postprocessConfiguration, renderAjaxAttributes, renderAjaxAttributes, respond
afterRender, bind, getCallbackUrl, getComponent, onComponentRendered, onComponentTag, onComponentTag, onUnbind, unbind
public AbstractYuiAjaxBehavior(IAjaxSettings settings)
protected void updateAjaxSettings()
protected void updateAjaxAttributes(org.apache.wicket.ajax.attributes.AjaxRequestAttributes attributes)
updateAjaxAttributes
in class org.apache.wicket.ajax.AbstractDefaultAjaxBehavior
public void addHeaderContribution(IYuiContext context)
context
- The IYuiContext this behavior can use to register YUI-modules and the likes.public void renderHead(org.apache.wicket.Component component, org.apache.wicket.markup.head.IHeaderResponse response)
renderHead
in interface org.apache.wicket.markup.html.IComponentAwareHeaderContributor
renderHead
in class org.apache.wicket.ajax.AbstractDefaultAjaxBehavior
protected void onRenderHead(org.apache.wicket.markup.head.IHeaderResponse response)
Copyright © 2007–2016 Hippo B.V. (http://www.onehippo.com). All rights reserved.