public AjaxRequestBuilder delay(String delay) {
        if (LangUtils.isNotBlank(delay) && !"none".equals(delay)) {
            buffer.append(",d:").append(delay);

            if (context.isProjectStage(ProjectStage.Development)) {
                try {
                    Integer.parseInt(delay);
                }
                catch (NumberFormatException e) {
                    throw new FaceletException("Delay attribute should only take numbers or \"none\"");
                }
            }
        }

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