Class 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 AbstractDefaultAjaxBehaviors 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:
    Serialized Form
    • Field Summary

      • Fields inherited from class org.apache.wicket.ajax.AbstractDefaultAjaxBehavior

        INDICATOR
    • 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 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()  
      • 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 interface org.apache.wicket.IRequestListener

        rendersPage
    • 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 class org.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 interface org.apache.wicket.markup.html.IComponentAwareHeaderContributor
        Overrides:
        renderHead in class org.apache.wicket.ajax.AbstractDefaultAjaxBehavior
      • onRenderHead

        protected void onRenderHead​(org.apache.wicket.markup.head.IHeaderResponse response)