Search in sources :

Example 1 with IComponentAwareHeaderContributor

use of org.apache.wicket.markup.html.IComponentAwareHeaderContributor in project wicket by apache.

the class AbstractDefaultAjaxBehavior method renderExtraHeaderContributors.

/**
 * Renders header contribution by IAjaxCallListener instances which additionally implement
 * IComponentAwareHeaderContributor interface.
 *
 * @param component
 *            the component assigned to this behavior
 * @param response
 *            the current header response
 */
private void renderExtraHeaderContributors(final Component component, final IHeaderResponse response) {
    AjaxRequestAttributes attributes = getAttributes();
    List<IAjaxCallListener> ajaxCallListeners = attributes.getAjaxCallListeners();
    for (IAjaxCallListener ajaxCallListener : ajaxCallListeners) {
        if (ajaxCallListener instanceof IComponentAwareHeaderContributor) {
            IComponentAwareHeaderContributor contributor = (IComponentAwareHeaderContributor) ajaxCallListener;
            contributor.renderHead(component, response);
        }
    }
}
Also used : AjaxRequestAttributes(org.apache.wicket.ajax.attributes.AjaxRequestAttributes) IComponentAwareHeaderContributor(org.apache.wicket.markup.html.IComponentAwareHeaderContributor) IAjaxCallListener(org.apache.wicket.ajax.attributes.IAjaxCallListener)

Aggregations

AjaxRequestAttributes (org.apache.wicket.ajax.attributes.AjaxRequestAttributes)1 IAjaxCallListener (org.apache.wicket.ajax.attributes.IAjaxCallListener)1 IComponentAwareHeaderContributor (org.apache.wicket.markup.html.IComponentAwareHeaderContributor)1