Example usage for org.apache.wicket.markup.html IComponentAwareHeaderContributor renderHead

List of usage examples for org.apache.wicket.markup.html IComponentAwareHeaderContributor renderHead

Introduction

In this page you can find the example usage for org.apache.wicket.markup.html IComponentAwareHeaderContributor renderHead.

Prototype

void renderHead(Component component, IHeaderResponse response);

Source Link

Document

Render to the web response whatever the component-aware wants to contribute to the head section.

Usage

From source file:com.comcast.cdn.traffic_control.traffic_monitor.wicket.behaviors.AbstractMultiAjaxBehavior.java

License:Apache License

/**
 * Renders header contribution by IAjaxCallListener instances which
 * additionally implement IComponentAwareHeaderContributor interface.
 * //  w ww . j  a  v  a  2 s .c om
 * @param component
 *            the component assigned to this behavior
 * @param response
 *            the current header response
 */
private void renderExtraHeaderContributors(final Component component, final IHeaderResponse response) {
    final AjaxRequestAttributes attributes = getAttributes();

    final List<IAjaxCallListener> ajaxCallListeners = attributes.getAjaxCallListeners();
    for (IAjaxCallListener ajaxCallListener : ajaxCallListeners) {
        if (ajaxCallListener instanceof IComponentAwareHeaderContributor) {
            final IComponentAwareHeaderContributor contributor = (IComponentAwareHeaderContributor) ajaxCallListener;
            contributor.renderHead(component, response);
        }
    }
}