Monday, May 4, 2009

GWT-EXT error: com.google.gwt.core.client.JavaScriptException: (TypeError): '$wnd.Ext.StatusBar' is null or not an object

The reason why you are getting this error is most probably because you have not installed ext and included the ext.jar file in your build path. Hence, you have a ext wrapper classes (eg. Gwt-Ext) but not EXT itself.

First of all, download EXT 2.0.2 from http://yogurtearl.com/ext-2.0.2.zip (link can be seen in http://code.google.com/p/gwt-ext/)

Then, add the ext-base.js, ext-all.js and ext-core.js files into the public folder of you GWT project. (eg. in com.redflex.gwt.public.js)

Then, define these in your project's html file:
< !--include the Ext CSS-- >
< link rel="stylesheet" type="text/css" href="js/ext/ext-all.css" / >

< !--include the Ext Core API-- >
< script type="text/javascript" src="js/ext/adapter/ext/ext-base.js" >< / script >


< !--include Ext -- >
< script type="text/javascript" src="js/ext/ext-all.js" > < / script >


This provides access to Ext's Javascript functions which resolves the " '$wnd.Ext.StatusBar' is null or not an object" error.


Make sure your paths to the ext-base.js, ext-all.js and ext-core.js files are correct into you < script > tags.

You can also copy all the other css files in the resources folder of Ext 2.0.2. This will allow your widgets to look like the ones shown in http://code.google.com/p/gwt-ext/

7 comments:

  1. thanks for shared

    ReplyDelete
  2. Thanks man!
    You saved my life!

    ReplyDelete
  3. hi, i am new to GWT.i have configured GWT thru install software in Eclipse (galilio).i can able to use the basic controls in that. When browsing i come across gwt-ext. I faced the same problem which is mentioned above and now it got solved. i refered http://www.gwt-ext.com/demo/#messageBox -- basic array grid example which suit my requirement. UI part is not rendering as shown in the example. plz guide me reg the same.looking for your valuable inputs.
    Cheers!!!

    ReplyDelete
  4. Hi Anonymous,

    Do you get any error messages? If so, post it here. Have you also looked at the GWT-EXT source code to render message boxes?

    ReplyDelete
  5. hi Chitra, thanks for ur reply.there was a problem in path which maps the css in .xml file.now that problem got solved. In m now running the example which is mention in http://www.gwt-ext.com/demo/#checkboxSelectionGrid --> grid box row selection. when i run the sample, check box which is suppose to come is not displaying and even the button is not triggering the action.i just copy&paste the code from GWT Showcase. I dont know what's wrong in that.I m using GWT-Ext 2.0.5 (gwtext.jar). looking for ur inputs.
    Cheers!!!
    Mohan

    ReplyDelete
  6. Hi Team,
    I took the src code for my sample work from http://www.gwt-ext.com/demo/#checkboxSelectionGrid. i have following issues

    1.By the time of running the sample i got some JS error. when i search in google i found that in *.nocatch.js i have removed the following line
    if(!__gwt_scriptsLoaded[ec]){__gwt_scriptsLoaded[ec]=true;document.write(fc+wc+gc)}.
    By then,I did not get the js error. (I don't know whether is this correct or not)
    2. Check boxes in the grid are not rendering. I am not able to see the check boxes.
    3. On the button, I am triggering an action where i get the selected rows. Here I want to change the back colour of the selected Rows.
    I m using GWT-Ext 2.0.5 with eclipse and am totally struck in this part for almost a day. Kindly give ur inputs for the issue.

    Thanks,
    Mohan

    ReplyDelete

Thank you for your comment.