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

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

Introduction

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

Prototype

default CharSequence getCompleteHandler(Component component) 

Source Link

Document

The JavaScript that will be executed after both successful and unsuccessful return of 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;
        }/*ww w .j a va 2  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);
    }
}