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 view this discussion on the web visit
https://groups.google.com/d/msg/google-web-toolkit/-/3_yCx0A8wyUJ.
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.