PDA

View Full Version : [CLOSED]form upload submit bug when server response 500 error



greco
29 Apr 2011, 6:54 PM
In Ext.form.action.Submit#handleResponse:


return Ext.decode(response.responseText);

when server response 500, Ext.form.action.Submit#onSuccess will be crashed.

any callback can not called

so my app still loading... loading...

where can i handling this error

evant
1 May 2011, 11:32 PM
If the server responds with a 500 it will never get to the onSuccess method of the action. The Ajax request failure is fired since it returns a 500 response, which means onFailure is called.

If you need to handle this in your code, listen to the failure callback:



Ext.onReady(function() {

var form = Ext.create('Ext.form.Panel', {
width: 400,
height: 400,
renderTo: document.body,
items: {
name: 'foo',
xtype: 'textfield'
}
});

setTimeout(function(){
form.getForm().submit({
waitMsg: 'Saving',
url: 'some500.asp',
failure: function(){
console.log('failed');
}
});
}, 1000);

});

greco
4 May 2011, 2:10 AM
thanks your reply,
but i mean use upload field

when use upload field, the form not use ajax