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 =
th...@com.gwtext.client.widgets.component::getOrCreateJsObj()();

        pagingToolbar.field.on("keydown", function(e) {
                alert("1");
                th...@mypackage.pagetoolbar::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 Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to