public AjaxRequestBuilder source(String source) {
        if (source != null) {
            buffer.append("s:").append("\"").append(source).append("\"");
        }
        else {
            buffer.append("s:").append("this");
        }

        return this;
    }
Helper to generate javascript code of an ajax call
primefaces/src/main/java/org/primefaces/util/AjaxRequestBuilder.java