Re: How can I disable the browser's default right click response?
Tried eventPreventDefault? 2009/12/5 Rob Tanner > Hi, > > I want to add short context specific help messages when users right- > click into a text box. Figuring out what button the pressed on the > mouse is a near no-brainer, but how to disable the default browser > response is a puzzler. I've figured out how to disable right clicks > all together using the native interface: > >public static native void disableContextMenu(Element e) /*-{ >e.oncontextmenu = function() { return false; }; >}-*/; > > But then I don't see them either. All I want is to disable the > default context menu so that I can roll my own. Any ideas? > > Thanks, > Rob > > -- > > You received this message because you are subscribed to the Google Groups > "Google Web Toolkit" group. > To post to this group, send email to google-web-tool...@googlegroups.com. > To unsubscribe from this group, send email to > google-web-toolkit+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/google-web-toolkit?hl=en. > > > -- Regards, Alexander -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: How can I disable the browser's default right click response?
Can't you just return false for oncontextmenu ? On Dec 8, 5:01 am, Alexander wrote: > Tried eventPreventDefault? > > 2009/12/5 Rob Tanner > > > > > > > Hi, > > > I want to add short context specific help messages when users right- > > click into a text box. Figuring out what button the pressed on the > > mouse is a near no-brainer, but how to disable the default browser > > response is a puzzler. I've figured out how to disable right clicks > > all together using the native interface: > > > public static native void disableContextMenu(Element e) /*-{ > > e.oncontextmenu = function() { return false; }; > > }-*/; > > > But then I don't see them either. All I want is to disable the > > default context menu so that I can roll my own. Any ideas? > > > Thanks, > > Rob > > > -- > > > You received this message because you are subscribed to the Google Groups > > "Google Web Toolkit" group. > > To post to this group, send email to google-web-tool...@googlegroups.com. > > To unsubscribe from this group, send email to > > google-web-toolkit+unsubscr...@googlegroups.com > cr...@googlegroups.com> > > . > > For more options, visit this group at > >http://groups.google.com/group/google-web-toolkit?hl=en. > > -- > Regards, > Alexander -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: How can I disable the browser's default right click response?
Here's a little snippet that doesn't do what I hoped: public static native void disableContextMenu(Element e) /*-{ e.oncontextmenu = function() { return false; }; }-*/; And I call that method immediately before I add the minPanel to the RootPanel: DataManager.disableContextMenu(mainPanel.getElement()); Now, not only do I not see the default browser behavior, I don't see right clicks at all. In my TextBox() I added the click handler. When the handler gets triggered, I get the NativeEvent from the ClickEvent (NativeEvent nevn = event.getNativeEvent()) in order to detect which button, etc, and the right button is never caught. -- Rob On Dec 8, 7:32 am, Mohamed Mansour wrote: > Can't you just return false for oncontextmenu ? > > On Dec 8, 5:01 am, Alexander wrote: > > > > > Tried eventPreventDefault? > > > 2009/12/5 Rob Tanner > > > > Hi, > > > > I want to add short context specific help messages when users right- > > > click into a text box. Figuring out what button the pressed on the > > > mouse is a near no-brainer, but how to disable the default browser > > > response is a puzzler. I've figured out how to disable right clicks > > > all together using the native interface: > > > > public static native void disableContextMenu(Element e) /*-{ > > > e.oncontextmenu = function() { return false; }; > > > }-*/; > > > > But then I don't see them either. All I want is to disable the > > > default context menu so that I can roll my own. Any ideas? > > > > Thanks, > > > Rob > > > > -- > > > > You received this message because you are subscribed to the Google Groups > > > "Google Web Toolkit" group. > > > To post to this group, send email to google-web-tool...@googlegroups.com. > > > To unsubscribe from this group, send email to > > > google-web-toolkit+unsubscr...@googlegroups.com > > cr...@googlegroups.com> > > > . > > > For more options, visit this group at > > >http://groups.google.com/group/google-web-toolkit?hl=en. > > > -- > > Regards, > > Alexander -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: How can I disable the browser's default right click response?
Here you have some solutions: http://ui-programming.blogspot.com/2009/12/gxt-ext-gwt-how-can-i-disable-browsers.html I hope they are good for you! Cheers. -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.