Example usage for org.apache.wicket.ajax.attributes IAjaxCallListener getAfterHandler

List of usage examples for org.apache.wicket.ajax.attributes IAjaxCallListener getAfterHandler

Introduction

In this page you can find the example usage for org.apache.wicket.ajax.attributes IAjaxCallListener getAfterHandler.

Prototype

default CharSequence getAfterHandler(Component component) 

Source Link

Document

The JavaScript that will be executed after the Ajax call.

Usage

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

License:Apache License

private void appendListenerAtts(final JSONObject attributesJson,
        final List<IAjaxCallListener> ajaxCallListeners) throws JSONException {
    for (IAjaxCallListener ajaxCallListener : ajaxCallListeners) {
        if (ajaxCallListener == null) {
            continue;
        }//  w  w w. ja  v a2  s. c  o m
        appendListenerHandler(ajaxCallListener.getBeforeHandler(component), attributesJson, "bh", FUNC_STR);
        appendListenerHandler(ajaxCallListener.getBeforeSendHandler(component), attributesJson, "bsh",
                "function(attrs, jqXHR, settings){%s}");
        appendListenerHandler(ajaxCallListener.getAfterHandler(component), attributesJson, "ah", FUNC_STR);
        appendListenerHandler(ajaxCallListener.getSuccessHandler(component), attributesJson, "sh",
                "function(attrs, jqXHR, data, textStatus){%s}");
        appendListenerHandler(ajaxCallListener.getFailureHandler(component), attributesJson, "fh",
                "function(attrs, jqXHR, errorMessage, textStatus){%s}");
        appendListenerHandler(ajaxCallListener.getCompleteHandler(component), attributesJson, "coh",
                "function(attrs, jqXHR, textStatus){%s}");
        appendListenerHandler(ajaxCallListener.getPrecondition(component), attributesJson, "pre", FUNC_STR);
    }
}