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

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

Introduction

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

Prototype

default CharSequence getFailureHandler(Component component) 

Source Link

Document

The JavaScript that will be executed after 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;
        }//from ww  w.  j a  v a2  s .c  om
        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);
    }
}