Child menu action gets fired when its parent menu is clicked [message #66809] |
Mon, 17 December 2007 02:03 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
|
Hi,
I have the following menu hierarchy in RAP :
File
|
Explorer
|
|- Show
|- Activate
Show & Activate menu is actually the child menu of Explorer and Explorer
is the child menu of File.
When I click Explorer menu to display Show & Activate menu the Show menu's
action always get fired as if the Show menu is clicked. This makes me
impossible to distinguish whether the events come from the Explorer or
Show menu itself.
Is this a known bug ?
Thanks and Regards,
Setya
|
|
|
|
Re: Child menu action gets fired when its parent menu is clicked [message #66962 is a reply to message #66936] |
Tue, 18 December 2007 05:20 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
|
Benny,
I have solved the problem.
The problem is triggered by the fact that I reuse the same Explorer action
for both menu and toolbar.
In the Explorer action I put the following code :
public void run()
{
showAction.run();
}
With the above code I want to trigger the Show's action whenever Explorer
button in the toolbar is clicked, but I forgot to consider the fact that
the same action is also used for the menu.
So I replace the method with :
public void runWithEvent(Event event)
{
if (event.widget.getClass().equals(ToolItem.class))
{
showAction.run();
return;
}
super.runWithEvent(event);
}
And the problem is solved.
Sorry for all the trouble and thank you for your time to investigate.
Best Regards,
Setya
|
|
|
Powered by
FUDForum. Page generated in 0.04179 seconds