Menu

#1 ContextMenu not working

open
nobody
5
2006-09-29
2006-09-29
Anonymous
No

I set up a trivial ContextMenu in a Widget's
constructor:

final ContextMenu contextMenu = new
ContextMenu();
// Get the menu component
final ContextMenuBar contextMenuBar =
contextMenu.getMenuBar();
// Add some items
contextMenuBar.addItem("Basic Alert",
new Command() {
public void execute() {
Window.alert("Clicked
Alert from the right-click");
};
});

contextMenuBar.setAutoOpen(true);

// Attach this context menu to the
contentPanel object, defined
// elsewhere.
contextMenu.addContextToUIObject
(aSubObject);

Now in both the GWT Shell (IE on Windows) I get:

[WARN] Exception thrown into JavaScript
com.google.gwt.core.client.JavaScriptException:
JavaScript TypeError exception: 'clientX' is null or
not an object
at
com.google.gwt.dev.shell.ie.ModuleSpaceIE6.invokeNativ
e(ModuleSpaceIE6.java:396)
at
com.google.gwt.dev.shell.ie.ModuleSpaceIE6.invokeNativ
eInt(ModuleSpaceIE6.java:205)
at
com.google.gwt.dev.shell.JavaScriptHost.invokeNativeIn
t(JavaScriptHost.java:87)
at
com.google.gwt.user.client.impl.DOMImpl.eventGetClient
X(DOMImpl.java:57)
at
com.google.gwt.user.client.DOM.eventGetClientX
(DOM.java:337)
at
net.sf.jwc.gwt.user.client.ui.context.ContextMenu.onCo
ntextEvent(ContextMenu.java:164)
at
net.sf.jwc.gwt.user.client.ui.context.ContextEventHand
ler.onContextEvent(ContextEventHandler.java:131)
at
net.sf.jwc.gwt.user.client.ui.context.ContextEventHelp
er.dispatchEvent(ContextEventHelper.java:68)
at
com.google.gwt.dev.shell.ie.IDispatchImpl.callMethod
(IDispatchImpl.java:90)
at
com.google.gwt.dev.shell.ie.IDispatchProxy.invoke
(IDispatchProxy.java:121)

That is, it seems the original Event and the
Browser's info about it (notably X,Y co-ords) is
getting lost...

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.