javaScriptWriter.writeCall(null, "f_appendItem").write(parentVarId)
javaScriptWriter.writeMethodCall("f_appendItem").write(parentVarId)
    public int encodeNodeBegin(UIComponent component, SelectItem selectItem,            boolean hasChildren, boolean isVisible) throws WriterException {        IComponentRenderContext componentRenderContext = getComponentRenderContext();        Object selectItemValue = selectItem.getValue();        String value = convertItemValue(componentRenderContext, selectItemValue);        if (value == null) {            return EVAL_NODE;        }        if (hasChildren) {            if (getContext().getDepth() > 1) {                throw new WriterException(                        "Optgroup does not support more 1 level !", null,                        component);            }        }        String text = selectItem.getLabel();        if (jsVersion == false) {            if (hasChildren) {                writer.startElement("OPTGROUP");                if (text != null) {                    writer.writeAttribute("label", text);                }                return EVAL_NODE;            }            writer.startElement("OPTION");            writer.writeAttribute("value", value);            if (getContext().isValueSelected(selectItem, selectItemValue)) {                writer.writeAttribute("selected");                selectionCount++;            }            if (selectItem.isDisabled()) {                writer.writeAttribute("disabled");            }            String description = selectItem.getDescription();            if (selectItem.getDescription() != null) {                writer.writeAttribute("title", description);            }            if (selectItem instanceof IClientDataSelectItem) {                IClientDataSelectItem clientDataSelectItem = (IClientDataSelectItem) selectItem;                if (clientDataSelectItem.isClientDataEmpty() == false) {                    Map map = clientDataSelectItem.getClientDataMap();                    HtmlTools.writeClientData(writer, map);                }            }            if (text != null) {                // Le Label ne marche pas sous Gecko ! (argggggh !)                writer.writeText(text);            }            writer.endElement("OPTION");        } else {            SelectItemsJsContext selectItemsJsContext = (SelectItemsJsContext) selectItemsContext;            if (hasChildren) {                String varId = javaScriptWriter.getJavaScriptRenderContext()                        .allocateVarName();                javaScriptWriter.write(varId).write('=');                javaScriptWriter.writeCall(null, "f_appendItem").writeNull()                        .write(',').write(selectItem.getLabel());                int pred = 2; // value,selected                if (selectItem.isDisabled()) {                    for (; pred > 0; pred--) {                        javaScriptWriter.write(',').writeNull();                    }                    javaScriptWriter.write(',').writeBoolean(true);                    selectionCount++;                } else {                    pred++;                }                String description = selectItem.getDescription();                if (description != null) {                    for (; pred > 0; pred--) {                        javaScriptWriter.write(',').writeNull();                    }                    javaScriptWriter.write(',').writeString(description);                } else {                    pred++;                }                if (selectItem instanceof IClientDataSelectItem) {                    IClientDataSelectItem clientDataSelectItem = (IClientDataSelectItem) selectItem;                    Map map = clientDataSelectItem.getClientDataMap();                    if (map.isEmpty() == false) {                        for (; pred > 0; pred--) {                            javaScriptWriter.write(',').writeNull();                        }                        for (Iterator it = map.entrySet().iterator(); it                                .hasNext();) {                            Map.Entry entry = (Map.Entry) it.next();                            String dataKey = (String) entry.getKey();                            if (dataKey == null || dataKey.length() < 1) {                                continue;                            }                            Object dataValue = entry.getValue();                            if (dataValue != null) {                                dataValue = String.valueOf(dataValue);                            }                            javaScriptWriter.write(',').writeString(dataKey)                                    .write(',').writeString((String) dataValue);                        }                    }                }                javaScriptWriter.writeln(");");                selectItemsJsContext.pushVarId(varId);                return EVAL_NODE;            }            String parentVarId = null;            if (selectItemsJsContext.getDepth() > 1) {                parentVarId = selectItemsJsContext.peekVarId();            }            javaScriptWriter.writeCall(null, "f_appendItem").write(parentVarId)                    .write(',');            if (text == null) {                javaScriptWriter.writeNull();            } else {                javaScriptWriter.writeString(text);            }            int pred = 0;            if (value != null) {                javaScriptWriter.write(',').writeString(value);            } else {                pred++;            }            if (getContext().isValueSelected(selectItem, selectItemValue)) {                for (; pred > 0; pred--) {                    javaScriptWriter.write(',').writeNull();                }                javaScriptWriter.write(',').writeBoolean(true);            } else {                pred++;            }            if (selectItem.isDisabled()) {                for (; pred > 0; pred--) {                    javaScriptWriter.write(',').writeNull();                }                javaScriptWriter.write(',').writeBoolean(true);            } else {                pred++;            }            javaScriptWriter.writeln(");");        }        return EVAL_NODE;    }