Those lego pieces are the special get a box of em for 20 bucks pieces
-

To implement this functionality I would use a little bit of JSNI and
the onContextMenu functionality.

Open up your module's main .html file and locate your body element.
Add onContextMenu='someJavaScriptFunction()' to it.

Next, add a <script type='text/javascript'>function
someJavaScriptFunction(){ execute JSNI here }</script> to the inner
HTML of the head element and you are set!

If you've not read about JSNI, here is a good resource:
http://code.google.com/support/bin/answer.py?answer=75695&topic=10213

Obviously, this is a global solution - usually used to display an
alternate context menu. If you're trying to implement right-click for
a particular element that's a little bit more tricky and less reliable
across browsers.

On Dec 23, 3:23 pm, "David Hoffer" <dhoff...@gmail.com> wrote:
> Sounds good, I'll try that for DoubleClickEventListener.
>
> What lego pieces would you use to implement RightClickEventListener?
>
> -Dave
>
> On Tue, Dec 23, 2008 at 2:59 PM, lukehashj <bobwazn...@gmail.com> wrote:
>
> > If you want the double-click event, create a DoubleClickEventListener
> > that extends ClickListener. When the click event is fired a timer is
> > started - if they click again before the timer executes, the
> > onDoubleClick event fires. Otherwise, it's just treated as a single
> > click. Using this mechanism, you can adjust the speed at which the
> > user must double-click for you to get the event. This can be helpful
> > in improving your websites accessibility (ease of navigation, etc).
> > This also allows you to add a DoubleClickListener to any class that
> > implements the SourcesClickEvents class.
>
> > If you are rolling your own horizontal/vertical panels you're
> > approaching composition from the completely wrong direction.
> > You should probably create a class that extends Composite but includes
> > all the functionality that you would have added to the base GWT class
> > (es) and calls initWidget(on a horizontalPanel). Or, simply extend the
> > GWT class and add the missing/desired functionality to it.
>
> > The GWT widget/event classes are like legos - use the small parts to
> > build a greater cohesive structure. Don't plan on the legos coming out
> > of the box preassembled!
--~--~---------~--~----~------------~-------~--~----~
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-Toolkit@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
-~----------~----~----~----~------~----~------~--~---

Reply via email to