PDA

View Full Version : Help, having touble with the Ajax Forms with XML example.



TristanChappell
7 May 2010, 10:49 PM
Hello, I am a new user of the EXTJS libraries, and am trying to get my head round the Form load function.

I have copied the source code from http://www.extjs.com/deploy/dev/examples/form/xml-form.html including the relevant XML files into a local Visual Studio 2008 Web Application project and and hosting it in the IIS web server on my machine. My aspx page default.aspx loads up happily, and displays the form exactly as expected, but when I click the load button, the loading dialog pops up for a few seconds, then disappears, but no data is loaded.

I tried using

// simple button add
fs.addButton('Load', function(){
fs.getForm().load({url:'xml-form.xml', waitMsg:'Loading'});
});
to load from the local web server, and also

// simple button add
fs.addButton('Load', function() {
fs.getForm().load({ url: 'http://www.extjs.com/deploy/dev/examples/form/xml-form.xml', waitMsg: 'Loading' });
});
To load from the original website, but nothing happens either way, I just get left with empty fields on screen with the default values.

Same results in IE, Firefox and Chrome, and neither Chrome developer tools or Firefox's Firebug are showing any errors in the javascript. Is there some trick to getting these examples to work with IIS and Visual Studio that I don't know about ? Any help would be much appreciated.

Animal
7 May 2010, 11:32 PM
Have you debugged?

TristanChappell
8 May 2010, 1:31 AM
yes, I can see the load running, and I can trace it into the ext-all-debug.js file, all the way too

doAction : function(action, options){
if(Ext.isString(action)){
action = new Ext.form.Action.ACTION_TYPES[action](this, options);
}
if(this.fireEvent('beforeaction', this, action) !== false){
this.beforeAction(action);
action.run.defer(100, action);
}
return this;
},
and then I lose it there at the action.run.defer(100, action); line, I can't see where it goes from there. However, presumably it goes on and does it's load thing, and I don't get any exception or error back, so Im not sure how to proceed.

Animal
8 May 2010, 3:16 AM
Yes, that defer is very annoying.

You actually have to find the run method of Ext.form.Action.(Submit||Load), and set a breakpoint there, and then click "go".

Also, set a breakpoint in the Action's callback methods to pick up control when the response returns.

TristanChappell
8 May 2010, 3:36 AM
OK, I will try to find that method and see what is happening. Thank you.

mailme_gx
8 May 2010, 9:24 PM
I am also having trouble with defer... My issue is that the http server return a "500 internal server error" and the form.submit does not fire the "failure" callback, I also tried debugging but for stuck with the deffer. How are basic errors supposed to be handled? can I use a basic
Ext.Ajax.request({ form: myForm, url: 'serverfile.php', callback: myCallback }); Will this handle a file upload? Regards GX