Jay,

Yes, in my case at least, I want to use onBrowserEvent() like you say
but...and its a show stopper...I am doing this in a Tree widget.  Obviously
what someone cares about in this context is the TreeItem the user right
clicked on.  The problem is there is no way (that I have found yet) to
convert the Event object returned in onBrowserEvent() into the TreeItem the
user cares about.

So its not a notification problem its a data access problem.  I have looked
at how the Tree control does this for single clicks but they made all the
data & methods private so I can't use them.

If you know a way to do this please advice.

-Dave

On Tue, Dec 23, 2008 at 5:04 PM, jay <[email protected]> wrote:

>
> Perhaps I'm missing something, but why JSNI? Why not just override
> onBrowserEvent(), and use DOM.eventGetButton(Event) to check for
> Event.BUTTON_RIGHT?
>
> Can't you use the DOM.eventGetButton() to check for Event.ONDBLCLICK ?
>
> Please...if I'm wrong let me know... I've been fairly successful with
> my usage of GWT, but I'm always looking to learn how to do things
> better.
>
> jay
>
>
> On Dec 23, 2:49 pm, lukehashj <[email protected]> wrote:
> > 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" <[email protected]> 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 <[email protected]>
> 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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to