nodeRenderer.getDepth());
nodeRenderer.getDepth(), waitingVarId);
    private void writeJs(FacesContext facesContext, PrintWriter printWriter,            TreeComponent treeComponent, String treeId,            TreeRenderer treeRenderer, String waitingId, String node)            throws IOException {        CharArrayWriter cw = null;        PrintWriter pw = printWriter;        if (LOG.isTraceEnabled()) {            cw = new CharArrayWriter(2000);            pw = new PrintWriter(cw);        }        // String waitingVarId = "_rootNode";        IJavaScriptWriter jsWriter = new JavaScriptResponseWriter(facesContext,                pw, treeComponent, treeId);        String varId = jsWriter.getComponentVarName();        String waitingVarId = jsWriter.getJavaScriptRenderContext()                .allocateVarName();        jsWriter.write("var ").write(varId).write('=').writeCall("f_core",                "GetElementById").writeString(treeId).writeln(", document);");        jsWriter.write("with (").write(varId).writeln(") {");        jsWriter.write("var ").write(waitingVarId).write('=').writeCall(null,                "_getWaitingNode").write(waitingId).writeln(");");        // Le varName a utiliser est celui du waitingVarId !        // Car les noeuds sont encod�s par rapport � un parent nomm� par le        // componentVarName        jsWriter.setComponentVarName(waitingVarId);        ISelectItemNodeWriter nodeWriter = treeRenderer                .getSelectItemNodeWriter(jsWriter.getComponentRenderContext());        FilterNodeRenderer nodeRenderer = new FilterNodeRenderer(node,                nodeWriter);        treeRenderer.encodeNodes(jsWriter, treeComponent, nodeRenderer,                nodeRenderer.getDepth());        /*         * TreeRenderContext treeRenderContext = treeRenderer.createTreeContext(         * facesContext, dgc, rowIndex, sortIndex, sortOrder, filterExpression);         */        // treeRenderer.encodeJsTransactionalRows(jsWriter, treeRenderContext);        jsWriter.writeCall(null, "_clearWaiting").write(waitingId)                .writeln(");");        jsWriter.writeln("}");        if (LOG.isTraceEnabled()) {            pw.flush();            LOG.trace(cw.toString());            printWriter.write(cw.toCharArray());        }    }