jsWriter.writeCall(null, "_updateNewPage").writeln(");");  jsWriter.writeln("}");
jsWriter.writeMethodCall("_updateNewPage").writeln(");");
    private void writeJs(FacesContext facesContext, PrintWriter printWriter,            DataGridComponent dgc, String componentId, DataGridRenderer dgr,            int rowIndex, ISortedComponent sortedComponents[],            String filterExpression) throws IOException {        DataGridRenderer.TableRenderContext tableContext = dgr                .createTableContext(facesContext, dgc, rowIndex,                        sortedComponents, filterExpression);        CharArrayWriter cw = null;        PrintWriter pw = printWriter;        if (LOG.isTraceEnabled()) {            cw = new CharArrayWriter(2000);            pw = new PrintWriter(cw);        }        IJavaScriptWriter jsWriter = new JavaScriptResponseWriter(facesContext,                pw, dgc, 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(") {");        jsWriter.writeCall(null, "_startNewPage").writeInt(rowIndex).writeln(                ");");        String rowVarId = jsWriter.getJavaScriptRenderContext()                .allocateVarName();        tableContext.setRowVarName(rowVarId);        dgr.encodeJsTransactionalRows(jsWriter, tableContext, false);        jsWriter.writeCall(null, "_updateNewPage").writeln(");");        jsWriter.writeln("}");        if (LOG.isTraceEnabled()) {            pw.flush();            LOG.trace(cw.toString());            printWriter.write(cw.toCharArray());        }    }