Thomas, your example with $entry worked perfectly. I have a question about your code snippet: which is representing *that* var assignment in this case and why Is It necessary to use It?. Thanks, Jésica.
On Sep 15, 7:40 am, Thomas Broyer <[email protected]> wrote: > On Wednesday, September 14, 2011 6:57:42 PM UTC+2, Jésica wrote: > > > Hi, I'm facing problems for calling a native method from another. i'm > > trying to do It like this: > > > //JSNI code > > public native void dragStart()/*-{ > > alert("OnDragStart"); > > }-*/; > > > public native void addPushpin()/*-{ > > (...) > > blah.Events.addHandler(pin, 'dragstart', dragStart); > > This should work: > > var that = this; > blah.Events.addHandler(pin, 'dragstart', $entry(function() { > [email protected]::dragStart()(); > > })); > > ($entry() is so that exceptions throw by the wrapped function, thus by your > dragStart method, which the wrapped function calls, will go through > GWT.UncaughtExceptionHandler; it also ensures Scheduler#scheduleEntry and > Scheduler#scheduleFinally commands will be run around that call back to Java > code) -- 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.
