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

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

Introduction

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

Prototype

default CharSequence getPrecondition(Component component) 

Source Link

Document

A JavaScript function that is invoked before the request is being executed.

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   w w 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);
    }
}