Hi list,
I want to setup a listener to a widget from java code using JSNI. The
listener will call java method. Here's my code:
class PageToolbar extends PagingToolbar {
private native void patch() /*-{
var pagingToolbar =
[email protected]::getOrCreateJsObj()();
pagingToolbar.field.on("keydown", function(e) {
alert("1");
[email protected]::mymethod()();
alert("2");
}, pagingToolbar);
}-*/;
private void mymethod() {
...
}
}
The problem is that this code does not work, because "this" is not
PageToolbar inside event handling function. Likely this is because
this is inner function. Is there any way I can access enclosing "this"
instance (that would be PageToolbar)?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---