PDA

View Full Version : IE7: 'null' is null or not an object



igitur
27 Sep 2010, 1:04 AM
Hi,

I have some very simple code: An autoload tab inside a tabpanel inside a window.

On IE7 it's throwing a 'null' is null or not an object error.

This seems to be a bug. The code works fine in Fx and Chrome.


Ext.onReady(function () {
var myWindow = new Ext.Window({
id: "MyWindow",
hidden: false,
height: 550,
width: 750,
layout: "fit",
items: new Ext.TabPanel({
id: "IBMTabPanel",
activeTab: 0,
items: [{
id: "IBMTab2",
title: "IBM Tab",
xtype: "panel",
autoLoad: {
url: "http://www.ibm.com"
}
}]
})
});
});

I'm using Windows XP, IE7, ExtJS 3.2.0 to simulate this error.

evant
27 Sep 2010, 1:31 AM
You can't autoLoad from a different domain, it uses an Ajax request: https://developer.mozilla.org/En/Same_origin_policy_for_JavaScript

igitur
27 Sep 2010, 1:33 AM
The exception occurs even if I use the same domain. The www.ibm.com was only for demo purposes. Anyway, the XHR exception would be something totally else, like 'Access Denied'.

evant
27 Sep 2010, 1:39 AM
If I change the url to some local page it works fine for me. Follow the stack trace and see what's causing it.

igitur
27 Sep 2010, 2:08 AM
Ok, sorry, maybe I should have given more detail upfront, but I wanted to keep it simple.

I'm using Ext.NET v1, and the code I posted above was a reduced test case of the problem I'm experiencing.

I see only now that Ext.NET is overriding Panel so that you can load content in an iframe inside a Panel (e.g. it adds a isIFrame method).

It's when I use iframed content that I experience the problem. So I'm not sure whether the bug itself is in ExtJS or Ext.NET.

In any case, this is the part which bombs out in IE7:


// private
layout : function(){
var ct = this.container, target = ct.getLayoutTarget();
if(!(this.hasLayout || Ext.isEmpty(this.targetCls))){
target.addClass(this.targetCls);
}
this.onLayout(ct, target);
ct.fireEvent('afterlayout', ct, this);
},

The problem is that this.container == null

igitur
30 Sep 2010, 5:34 AM
Is this an ExtJS or Ext.NET bug?