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 forAbstractDefaultAjaxBehavior
s that want to use YUI modules. It uses aIYuiContext
to register all required components. TheIYuiContext
is created by a (global)IYuiManager
which, in this case, lives inside thePage
(as anBehavior
) that is retrieved bycomponent.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 theAbstractDefaultAjaxBehavior
.Subclasses should override
addHeaderContribution(IYuiContext context)
to get access to theIYuiContext
.Note: This behavior skips adding the necessary Wicket-Ajax header contributions, as this is handled by the
YuiHeaderCache
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractYuiAjaxBehavior(IAjaxSettings settings)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
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
updateAjaxSettings()
-
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
-
-
-
-
Constructor Detail
-
AbstractYuiAjaxBehavior
public AbstractYuiAjaxBehavior(IAjaxSettings settings)
-
-
Method Detail
-
updateAjaxSettings
protected void updateAjaxSettings()
-
updateAjaxAttributes
protected void updateAjaxAttributes(org.apache.wicket.ajax.attributes.AjaxRequestAttributes attributes)
- Overrides:
updateAjaxAttributes
in classorg.apache.wicket.ajax.AbstractDefaultAjaxBehavior
-
addHeaderContribution
public void addHeaderContribution(IYuiContext context)
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)
-
-