I just started to learn ZK, and I'm having a seriuos problem to intercept an event (onClick) from a parent menubar that contain several menu and menuitem.

I'm using AJAX to change the src uri of a internal panel.

I don't want to create a unique class for each menuitem.

I want to (but I don't know if and how is possible) to create a class to intercept onClick event from menubar, BUT when such event appear, in fact, on a menuitem.

So I want to tie the class controller to menubar, but, at the same time, get the menuitem that the user click on.

Here my code:

Index.zul

```
<zk>
<style>.z-menubar-hor, .z-menubar-ver { border: 1px solid #D8D8D8; }
.content {overflow-x: hidden;overflow-y: scroll;}</style>

        <borderlayout hflex="1" vflex="1" id="mainBorder">
            <north>
                <include src="topBanner.zul"/>
            </north>
            <west>
                <panel hflex="1" vflex="1" border="normal" title="MENU COMANDI" apply="mainPage.MenuAjaxbasedController">
                    <panelchildren style="padding:5px;">
                        <menubar id="menubar" orient="vertical" autodrop="true">
                            <menu label="ANAGRAFICA" id="anagrafica">
                                <menupopup>
                                    <menuitem id="contatti" label="CONTATTI" />
                                    <menuitem id="listeDiDistribuzione" label="LISTE DISTRIBUZIONE" />
                                    <menuitem id="sottoscrizioni" label="SOTTOSCRIZIONI" />
                                    <menuitem id="profilo" label="PROFILO" />
                                </menupopup>
                            </menu>
                            <menu label="MESSAGGI">
                                <menupopup>
                                    <menuitem id="nuovaNewsletter" label="NUOVA NEWSLETTER" />
                                    <menuitem id="messaggiInviati" label="MESSAGGI INVIATI" />
                                    <menuitem id="bozze" label="BOZZE" />
                                </menupopup>
                            </menu>
                            <menu label="STRUMENTI">
                                <menupopup>
                                    <menuitem id="smtpServers" label="SMTP SERVERS" />
                                </menupopup>
                            </menu>
                        </menubar>
                    </panelchildren>
                </panel>
            </west>
            <center id="mainContent" autoscroll="true" border="none">
                <include id="mainContentInclude" self="@define(content)" src=""/>
            </center>
            <south>
                <include src="bottomFooter.zul"/>
            </south>
        </borderlayout>

```

MenuAjaxBasedController.java

```
public class MenuAjaxbasedController extends SelectorComposer<Component>{

private static final long serialVersionUID = 1L;

@Wire
Center mainContent;

@Wire
Borderlayout mainBorder;

@Wire
Menuitem contatti;

@Wire
Include mainContentInclude;

@Wire
Menubar menubar;

@Listen("onClick = #contatti")
public void change_page(Event e){
    // Menubar mb = (Menubar) e.getTarget();
    System.out.println(e.getTarget());
    String locationUri = "anagraficaContattiMainGrid.zul";
    // alert("menu link test");
    Include include = (Include)Selectors.iterable(mainBorder.getPage(), "#mainContentInclude").iterator().next();
    include.setSrc(locationUri);
}

}

```

As you can see, I'm only listening a single menuitem now.

Thanks very much and best regards.