SmartGWT 2.2
I need to disable the right-click context menu on an image, but no matter what I try, the menu persists. Here is what I believe I am supposed to do:
If I uncomment sectorImg.setContextMenu(new Menu()); then I get a one-line context menu that says "Empty Menu", but I want NO right-click context menu.
I assume the event.cancel() is supposed to stop the context menu from appearing, but I guess it isn't working? The menu that's coming up is the browser image context menu (save image as... etc.)
Thanks!
Ken
I need to disable the right-click context menu on an image, but no matter what I try, the menu persists. Here is what I believe I am supposed to do:
Code:
private void addEvent(final GWTSector gwtSector, Img sectorImg) { // sectorImg.setContextMenu(new Menu()); sectorImg.addRightMouseDownHandler(new RightMouseDownHandler() { public void onRightMouseDown(RightMouseDownEvent event) { StatusReporter.setText("selecting " + gwtSector.coords); event.cancel(); } });
I assume the event.cancel() is supposed to stop the context menu from appearing, but I guess it isn't working? The menu that's coming up is the browser image context menu (save image as... etc.)
Thanks!
Ken
Comment