View Full Version : Ext code in a native java method

16 Aug 2009, 2:27 AM
How can I set the title of the grid in a native java method by Ext code in Ext-Gwt application.
private native void MyMethod(GridPanel grid) /*-{
grid.setTitle("TITLE"); //this is not working.
pleeeease some one help me:((

Colin Alworth
16 Aug 2009, 9:31 PM
GridPanel is a GWT class, not a GXT one - so this isnt the forum for this question... And as far as I can tell, GridPanel isnt a class you can build into your app anyway - its part of the shell.

Assuming you mean some GXT Component (like the GXT grid) subclass, you need to reference the method fully in order to do this.

For JSNI info, see: http://code.google.com/webtoolkit/doc/1.6/DevGuideCodingBasics.html#DevGuideJavaScriptNativeInterface

Reference the method that you want, using the class that the method was declared/overridden in, not the class you have an instance of (setTitle is defined way up in in the abstract class Component)


16 Aug 2009, 10:56 PM
Hi for All
by using the line:
grid.@com.extjs.gxt.ui.client.widget.Component :: setTitle(Ljava/lang/String; )("TITLE");
it works very well.
thank you