-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi all,
I'm new to zk and got stack on a probably simple subject. I have a menupopup with 1 menuitem, labled "remove". This menupopup is in the contex of a Panel. when I dynamically add a new Panel to my window I assign the context attribute to this menupopup. In the menuitem I forward a onClick event to my controller (genericcontroller), how should remove this particular Panel from the window.
Now the question: how it is possible to get, in the controller onClick function, the id of the Panel who trigger the event? The one where I press the the context menu and chose Remove.
Thank
Hi.
I found a kinda solution:
In the event function on the controller:
public void onClickmenuPopupItem(Event evt){
ForwardEvent fe = (ForwardEvent) evt;
Event ev = fe.getOrigin();
// display id of the control who trigger the event
Messagebox.show("Control=" + ev.getTarget().getId()");
}
Asked: 2009-04-11 21:04:21 +0800
Seen: 150 times
Last updated: Apr 12 '09