javaScriptWriter.write("var ").write(varId).write('=').writeCall(null,
javaScriptWriter.write("var ").write(varId).write('=').writeMethodCall(
    private void encodeJsToolFolderBegin(UIComponent component,            SelectItem selectItem, boolean hasChild) throws WriterException {        if ((selectItem instanceof SelectItemGroup) == false) {            throw new FacesException(                    "Bad ToolItem type. (depth=1, Must be a selectItemGroup !)",                    null);        }        ToolBarContext toolBarContext = getToolBarContext();        IComponentRenderContext componentContext = writer                .getComponentRenderContext();        String varId = javaScriptWriter.getJavaScriptRenderContext()                .allocateVarName();        toolBarContext.pushVarId(varId);        String sid = toolBarContext.getComponentClientId(component); // menuContext.getMenuBarItemId();        javaScriptWriter.write("var ").write(varId).write('=').writeCall(null,                "_declareToolFolder").writeString(sid);        int pred = 0;        String value = convertItemValue(componentContext, selectItem.getValue());        if (value != null) {            for (; pred > 0; pred--) {                javaScriptWriter.write(',').writeNull();            }            javaScriptWriter.write(',').writeString(value);        } else {            pred++;        }        boolean disabled = selectItem.isDisabled();        if (disabled) {            for (; pred > 0; pred--) {                javaScriptWriter.write(',').writeNull();            }            javaScriptWriter.write(',').writeBoolean(true);        } else {            pred++;        }        javaScriptWriter.writeln(");");    }