0

Find the trigger element of a menuitem

asked 2009-04-11 21:04:21 +0800

kubiscopus gravatar image kubiscopus
40 1 1 2

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

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2009-04-12 21:08:19 +0800

kubiscopus gravatar image kubiscopus
40 1 1 2

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()");
}

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2009-04-11 21:04:21 +0800

Seen: 150 times

Last updated: Apr 12 '09

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More