PDA

View Full Version : exceptions when building an autoLoading FormPanel



aryairani
4 Mar 2011, 7:34 AM
Hi folks,

Been struggling with this for a couple days now, so hopefully I can still make sense.

I'm building a simple FormPanel, and the following works:



var loadConfig = {url: 'http://localhost:8080/whatever.json'}

var fieldSet = new Ext.form.FieldSet( /* stuff */ );

var formPanel = new Ext.form.FormPanel({
autoWidth: true,
items: fieldSet
});

formPanel.load(loadConfig);
and produces:

24979

It looks like the preferred way to do this, though, is using the autoLoad property, like so:



var formPanel = new Ext.form.FormPanel({
autoWidth: true,
autoLoad: loadConfig,
items: fieldSet
});
which produces the following undesirable result:

24980

(the json response all in a single field)

Equally confusing to me: from the docs, I got the impression that specifying autoLoad: loadConfig is supposed to acheive the same effect as:



var formPanel = new Ext.form.FormPanel({
autoWidth: true,
items: fieldSet
});
formPanel.getUpdater().update(loadConfig);
but instead, this yields an exception "this.body is undefined" in ext-all-debug.js line 17769:


getUpdater : function(){
return this.body.getUpdater(); // <-----
},
I'm using ext js 3.3.1, but I got the same error in 3.3.0, on the corresponding line.

Any suggestions?

Thanks in advance,
Arya

aryairani
4 Mar 2011, 7:38 AM
The forum software shrank the "bad" image to the point of being unreadable; here is an imgur-hosted copy.

http://i.imgur.com/CNfbo.png