jsWriter.writeln("}");
    private void writeJs(FacesContext facesContext, PrintWriter printWriter,            IFilterCapability component, String componentId,            IFilteredItemsRenderer dgr, IFilterProperties filterProperties,            int maxResultNumber) throws IOException {        CharArrayWriter cw = null;        PrintWriter pw = printWriter;        if (LOG.isTraceEnabled()) {            cw = new CharArrayWriter(2000);            pw = new PrintWriter(cw);        }        IJavaScriptWriter jsWriter = new JavaScriptResponseWriter(facesContext,                pw, (UIComponent) component, componentId);        String varId = jsWriter.getComponentVarName();        jsWriter.write("var ").write(varId).write('=').writeCall("f_core",                "GetElementById").writeString(componentId).writeln(                ", document);");        jsWriter.write("with(").write(varId).writeln(") {");        dgr.encodeFilteredItems(jsWriter, component, filterProperties,                maxResultNumber);        jsWriter.writeln("}");        if (LOG.isTraceEnabled()) {            pw.flush();            LOG.trace(cw.toString());            printWriter.write(cw.toCharArray());        }    }