Hmmmm, tanx Paul, I still think this is rather cumberslum to retrieve the element. I am currious what the idea behind this all is? and why the element isn't simple contained in the event and can be retrieves by a simple getter?
-- Ed On May 4, 12:12 pm, Paul Robinson <[email protected]> wrote: > Event.addNativePreviewHandler(new NativePreviewHandler() { > public void onPreviewNativeEvent(NativePreviewEvent event) { > EventTarget target = > event.getNativeEvent().getEventTarget(); > if (Element.is(target)) { > Element element = Element.as(target); > } > } > }); > > Paul > > Ed wrote: > > But what is the exact way? > > > Ed > > > On May 3, 2:22 pm, Salvador Diaz <[email protected]> wrote: > > >> On May 3, 1:47 pm, Ed <[email protected]> wrote: > > >>> Hellu, > > >>> I am trying to port to the new NativePreviewHandler as the > >>> EventPreview is deprecated in 1.6.4. > >>> A few questions: > >>> 1) How to retrieve the correct target element that fired the event > >>> preview. > > >>> In the past this was done by: > >>> Element target = DOM.eventGetTarget(event) > > >>> But how should this by done now with the new received > >>> NativePreviewEvent ? > > >> Hi, > > >> I think that you should be able to do it > >> with:http://google-web-toolkit.googlecode.com/svn/javadoc/1.6/com/google/g...() > >> and > >> then:http://google-web-toolkit.googlecode.com/svn/javadoc/1.6/com/google/g...() > >> and then cast as explained in the javadoc for > >> EventTarget:http://google-web-toolkit.googlecode.com/svn/javadoc/1.6/com/google/g... > > >> Hope that helps, > > >> Salvador > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
