protected WidgetBuilder init(String widgetClass, String widgetVar, String id, boolean endFunction) throws IOException {
        this.endFunction = endFunction;

        ResponseWriter rw = context.getResponseWriter();
        rw.write("PrimeFaces.cw(\"");
        rw.write(widgetClass);
        rw.write("\",\"");
        rw.write(widgetVar);
        rw.write("\",{id:\"");
        rw.write(id);
        rw.write("\"");

        return this;
    }
@param widgetClass   Constructor name of the widget
@param widgetVar     Name of the client side widget
@param id            Client id of the component
@param endFunction   If the init script is wrapped by a method and if the endFunction parentheses should be rendered.
@throws IOException if any IO exception occurs
@return              The current instance.
primefaces/src/main/java/org/primefaces/util/WidgetBuilder.java