Class AbstractYuiAjaxBehavior
java.lang.Object
org.apache.wicket.behavior.Behavior
org.apache.wicket.behavior.AbstractAjaxBehavior
org.apache.wicket.ajax.AbstractDefaultAjaxBehavior
org.hippoecm.frontend.plugins.yui.AbstractYuiAjaxBehavior
- All Implemented Interfaces:
Serializable
,org.apache.wicket.IComponentAwareEventSink
,org.apache.wicket.IRequestListener
,org.apache.wicket.markup.html.IComponentAwareHeaderContributor
,org.apache.wicket.util.io.IClusterable
- Direct Known Subclasses:
AbstractDragDropBehavior
,AutoCompleteBehavior
,TreeBehavior
,WireframeBehavior
public abstract class AbstractYuiAjaxBehavior
extends org.apache.wicket.ajax.AbstractDefaultAjaxBehavior
Base class for
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
- See Also:
-
Field Summary
Fields inherited from class org.apache.wicket.ajax.AbstractDefaultAjaxBehavior
INDICATOR
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addHeaderContribution
(IYuiContext context) Override this method to get access to the IYuiContextprotected 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
Methods inherited from class org.apache.wicket.ajax.AbstractDefaultAjaxBehavior
findIndicatorId, getAttributes, getCallbackFunction, getCallbackFunctionBody, getCallbackScript, getCallbackScript, onBind, onMethodMismatch, onRequest, postprocessConfiguration, renderAjaxAttributes, renderAjaxAttributes, respond
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, canCallListener, detach, getStatelessHint, isEnabled, isTemporary, onAttribute, onConfigure, onEvent, onException, onRemove, onTag
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.wicket.IRequestListener
rendersPage
-
Constructor Details
-
AbstractYuiAjaxBehavior
-
-
Method Details
-
updateAjaxSettings
protected void updateAjaxSettings() -
updateAjaxAttributes
protected void updateAjaxAttributes(org.apache.wicket.ajax.attributes.AjaxRequestAttributes attributes) - Overrides:
updateAjaxAttributes
in classorg.apache.wicket.ajax.AbstractDefaultAjaxBehavior
-
addHeaderContribution
Override this method to get access to the IYuiContext- Parameters:
context
- The IYuiContext this behavior can use to register YUI-modules and the likes.
-
renderHead
public 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.- Specified by:
renderHead
in interfaceorg.apache.wicket.markup.html.IComponentAwareHeaderContributor
- Overrides:
renderHead
in classorg.apache.wicket.ajax.AbstractDefaultAjaxBehavior
-
onRenderHead
protected void onRenderHead(org.apache.wicket.markup.head.IHeaderResponse response)
-