PDA

View Full Version : Uncaught TypeError: Cannot read property 'containerBox' of null



lasseok
13 Feb 2011, 2:10 PM
Hi

I have a panel where I need to create a form when the user clicks a button. But when I try to do that, I get the following error in Chrome's console:



Uncaught TypeError: Cannot read property 'containerBox' of null
Ext.Container.Ext.extend.onFieldFocussencha-touch-debug.js:20996
fieldEventWrap.focussencha-touch-debug.js:20937
firesencha-touch-debug.js:979
Ext.util.Observable.Ext.extend.fireEventsencha-touch-debug.js:595
Ext.form.Text.Ext.extend.onFocussencha-touch-debug.js:27592
anonymous:5
(anonymous function)


My code is simple:



//[...] Other panel stuff [...]

//When the user click a button:
contactScreen.add({
cls: 'editForm',
itemId: 'editForm',
xtype: 'formpanel',
items: [{
xtype: 'textfield',
itemId: 'name',
name: 'name',
label: 'Name'
}]
});

//[...] Other panel stuff [...]


If I just add a formpanel to the panel's items array before render everything is fine, unless I specify the hidden attribute of the formpanel. If I then call the show() method at runtime, I once again get the above error.

I'm mystified, so I would really appreciate some help!

lasseok
14 Feb 2011, 12:09 PM
Anyone?