javaScriptWriter.write("var ").write(menuVarName).write("=").writeCall( null, "_newSubMenu").writeString(menuId);
javaScriptWriter.write("var ").write(menuVarName).write("=") .writeMethodCall("_newSubMenu").writeString(menuId);
    protected SelectItemsContext createJavaScriptContext()            throws WriterException {        SelectItemsJsContext context = (SelectItemsJsContext) super                .createJavaScriptContext();        menuVarName = javaScriptWriter.getJavaScriptRenderContext()                .allocateVarName();        String id = context.getComponentClientId(getComponent());        javaScriptWriter.write("var ").write(menuVarName).write("=").writeCall(                null, "_newSubMenu").writeString(menuId);        int pred = 0;        if (independantMenu) {            javaScriptWriter.write(',').writeString(id);        } else {            pred++;        }        if (removeAllWhenShown) {            for (; pred > 0; pred--) {                javaScriptWriter.write(',').writeNull();            }            javaScriptWriter.write(',').writeBoolean(true);        } else {            pred++;        }        javaScriptWriter.writeln(");");        context.pushVarId(menuVarName);        return context;    }