On Jun 18, 2:08 am, rjcarr <[email protected]> wrote:
> I've been using GWT for a long time and I'm still a bit confused when
> I start working with events.
>
> So as the subject says, which should I use: DOM.eventCancelBubble() or
> NativeEvent.stopPropagation()?
Since all native events have a proper event object
(com.google.gwt.event.dom.client.*), I don't see the point of using
either :) That said, I think event.stopPropagation comes from the new
NativeEventObject, which I believe is new in 1.6, which implies that
DOM.eventCancelBubble would be the old method. Generally speaking
member methods at least have my preference over some global method.
> Similarly, I see this a lot:
>
> public void onBrowserEvent(Event event) {
> if(DOM.eventGetType(event) == ...) ...
>
> }
>
> Why not just:
>
> if(event.getType() == ...) ...
>
> ???
I believe using onBrowserEvent has been deprecated in 1.6 in favor of
the new EventHandler system, since it takes managing a lot of things
out of your hands.
> Is there some write-up that discusses events at a low level?
I don't think so, probably cause event handling changed in 1.6. If you
look in the 'what is new in 1.6' text on the gwt site, you'll see
explanations of the new handler system; I'd go for those methods.
Gert
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---