View Full Version : Please some one help me!!!?

16 Aug 2009, 4:36 AM
I had extended my Ext calculator component from a triggerfield, and now I am planing to use it in my GWT Ext application, but i dont know how to put the Ext code for the calculator in my gwt-ext application. Pleeeease some one help me how can i do it.

17 Aug 2009, 5:39 AM
the cleanest way: rewrite it in GXT.

you have a codesnippet of your ext calculator?

18 Aug 2009, 11:19 PM
I can now put the extended Ext component in my gwt-ext project by doing this:
first: call a native method in your project , and pass a Dom element of a panel for example as parameter to this native method like this:

Panel mypan = new Panel();
MyMethode(mypan.getElement());//call to a native method
...//remaining gwt code

second : we need a native method to put the ext code in it, as following:

private native void MyMethod(Element pan) /*-{ //this is a native method
new $wnd.Ext.ux.MyCalculator().render(pan); //note that this is Ext-js code

you can note that in a native method we can write javascript code or any javascript library code like Ext-js.
MyCalculator() class written in the file calc.js.
include this file and the ext library files in the file :yourProjectName.gwt.xml
like this:
<stylesheet src="../js/ext/resources/css/ext-all.css" ></stylesheet>
<stylesheet src="../js/Calculator.css" ></stylesheet>
<script src="../js/ext/adapter/ext/ext-base.js" ></script>
<script src="../js/ext/ext-all.js" ></script>
<script src="../js/calc.js" ></script>
try it.

19 Aug 2009, 5:33 AM
i see an problem if you try to load extjs css and gxt css in one page... (for example buttons are not rendered good)

19 Aug 2009, 5:38 AM
MyMethode(mypan.getElement());//call to a native method
That wont work if the panel is not rendered. It just returns a dummy element.