EventsRenderer.encodeEventListeners(javaScriptWriter, listenersByType, null);
EventsRenderer.encodeEventListeners(javaScriptWriter, context .peekVarId(), listenersByType, null);
    protected void encodeComponentsBegin() throws WriterException {        if (javaScriptWriter != null) {            javaScriptWriter.write("with(").write(menuVarName).writeln(") {");            if (independantMenu) {                Map listenersByType = ListenerTools.getListenersByType(                        ListenerTools.JAVASCRIPT_NAME_SPACE, component);                EventsRenderer.encodeEventListeners(javaScriptWriter,                        listenersByType, null);            }        }        super.encodeComponentsBegin();    }