1

Close menu after opening it and clicking somewhere else in the page

asked 2013-12-30 04:09:15 +0800

bhattsu gravatar image bhattsu
41 1

updated 2013-12-30 04:09:50 +0800

Following code is opening a popup menu when right clicking a row (say row #5). Good so far.

However when I click somewhere else on the page and click (NOT RIGHT CLICK), on the same row (row #5), it shows the popup menu again. But I am not right clicking. I am simply clicking the row.

How do I remove the opened menu once I click somewhere else so that this does not happen?

listItem.addEventListener(Events.ON_RIGHT_CLICK, new EventListener<Event>() {
    public void onEvent(Event event) throws Exception {
    XulElement xulElement = (XulElement) event.getTarget();
    Popup popup = (Popup) SH.getPopup("myPopup");
    xulElement.setPopup(popup);
    popup.setPage(xulElement.getPage());
    popup.open(xulElement);
    }
});
delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-01-21 07:49:41 +0800

chillworld gravatar image chillworld flag of Belgium
5322 4 9
https://github.com/chillw...

try not calling the popup.setPage. This only need to be set when its attached to a root component, otherwise its inherited.

link publish delete flag offensive edit
Your answer
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
1 follower

RSS

Stats

Asked: 2013-12-30 04:09:15 +0800

Seen: 6 times

Last updated: Jan 21 '14

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