javaScriptWriter.writeCall(null, "f_appendItem");
javaScriptWriter.writeMethodCall("f_appendItem");
    public int encodeNodeBegin(UIComponent component, SelectItem selectItem,            boolean hasChildren, boolean isVisible) throws WriterException {        count++;        if (maxResultNumber > 0 && count > maxResultNumber) {            return SKIP_NODE;        }        IComponentRenderContext componentRenderContext = getComponentRenderContext();        Object selectItemValue = selectItem.getValue();        String value = convertItemValue(componentRenderContext, selectItemValue);        if (value == null) {            return EVAL_NODE;        }        String text = selectItem.getLabel();        int pred = 0;        javaScriptWriter.writeCall(null, "f_appendItem");        if (text != null) {            javaScriptWriter.writeString(text);        } else {            pred++;        }        if (value != null) {            for (; pred > 0; pred--) {                javaScriptWriter.write(',').writeNull();            }            javaScriptWriter.write(',').writeString(value);        } 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 IImagesSelectItem) {            IImagesSelectItem imagesSelectItem = (IImagesSelectItem) selectItem;            String imageURL = imagesSelectItem.getImageURL();            if (imageURL != null) {                for (; pred > 0; pred--) {                    javaScriptWriter.write(',').writeNull();                }                javaScriptWriter.write(',').writeString(imageURL);            } else {                pred++;            }        } else {            pred++;        }        if (selectItem instanceof IClientDataSelectItem) {            IClientDataSelectItem clientDataSelectItem = (IClientDataSelectItem) selectItem;            if (clientDataSelectItem.isClientDataEmpty() == false) {                Map map = clientDataSelectItem.getClientDataMap();                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(");");        return EVAL_NODE;    }