Example usage for org.apache.wicket.ajax AbstractDefaultAjaxBehavior getCallbackFunctionBody

List of usage examples for org.apache.wicket.ajax AbstractDefaultAjaxBehavior getCallbackFunctionBody

Introduction

In this page you can find the example usage for org.apache.wicket.ajax AbstractDefaultAjaxBehavior getCallbackFunctionBody.

Prototype

public CharSequence getCallbackFunctionBody(CallbackParameter... extraParameters) 

Source Link

Document

Generates the body the #getCallbackFunction(CallbackParameter) callback function .

Usage

From source file:org.apache.openmeetings.web.util.CallbackFunctionHelper.java

License:Apache License

public static StringBuilder getNamedFunction(String name, AbstractDefaultAjaxBehavior b,
        CallbackParameter... extraParameters) {
    StringBuilder sb = new StringBuilder();
    sb.append("function ").append(name).append("(");
    boolean first = true;
    for (CallbackParameter curExtraParameter : extraParameters) {
        if (curExtraParameter.getFunctionParameterName() != null) {
            if (first) {
                first = false;//from   w  w  w.  j  a v a2s.com
            } else {
                sb.append(',');
            }
            sb.append(curExtraParameter.getFunctionParameterName());
        }
    }
    sb.append(") {\n");
    sb.append(b.getCallbackFunctionBody(extraParameters));
    sb.append("}\n");
    return sb;
}