Re: (JSNI) Accessing "this" instance from inner JS functions

2009-03-04 Thread Sumit Chandel
Hi Andrey, The last solution that Thomas and sutarsa girl proposed should do the trick (assigning the var to the 'this' variable before referencing functions from it). The reason why this must be done to make sure that the copy of the 'this' object that you're dealing with is what you expect it to

Re: (JSNI) Accessing "this" instance from inner JS functions

2009-03-01 Thread sutarsa giri
hi andrey, i usually use this trick when deal with this reference inside method class PageToolbar extends PagingToolbar { private native void patch() /*-{ var dummyThis=this; var pagingToolbar = th...@com.gwtext.client.widgets.component::getOrCreateJsObj()(); pagingToolbar.f

Re: (JSNI) Accessing "this" instance from inner JS functions

2009-03-01 Thread Shawn Brown
HI, > Is there any way I can access enclosing "this" > instance (that would be PageToolbar)? Pass it in, and call your method. It works for me. patch(this); //method call class PageToolbar extends PagingToolbar { private native void patch(PageToolbar pt) /*-{ /class of whatever gets passed i

Re: (JSNI) Accessing "this" instance from inner JS functions

2009-03-01 Thread Thomas Broyer
On 1 mar, 14:02, Andrey wrote: > 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

(JSNI) Accessing "this" instance from inner JS functions

2009-03-01 Thread Andrey
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()();