PDA

View Full Version : submit from error



Egort
19 Nov 2013, 11:39 AM
Hello all!

I have simple upload file form.
When I submit form I get error like submit was failed, but i know that submit was successful.

My form :


{xtype: 'form', name: 'form',
items: [{
xtype: 'filefield',
name: 'filename',
fieldLabel: 'File name:',
labelWidth: 50,
msgTarget: 'side',
allowBlank: false,
anchor: '100%',
padding: 10,
buttonText: 'Select file...'
}],

buttons: [{
text: 'Load',
handler: function() {
var form = this.up('form').getForm();
var window = this.findParentByType('window');
if(form.isValid()){
form.submit({
url: '!onepages.xml',
method: 'POST',
params:{xml: 13},
errorReader: new Ext.data.XmlReader({
record: 'row',
success: 'STATUS'
},
['STATUS']),
waitMsg: 'Loading...',
failure: function(form, action)
{
Ext.Msg.show({title:'Error', msg:'Error load file', buttons: Ext.MessageBox.OK, icon: Ext.MessageBox.ERROR});
},
success: function(form,action){
window.close();
}
});
}
}
}]
}


Server response



<?xml version="1.0" encoding="UTF-8"?>
<message success="true"><xmlpage> <result_rows>1</result_rows>
<result>
<row> <STATUS>true</STATUS> </row>
</result> </xmlpage></message>


What is wrong?

Any ideas ?

E

Gary Schlosberg
25 Nov 2013, 7:57 AM
So the client says it failed, but the server is getting the data?

Egort
25 Nov 2013, 12:12 PM
Correct

Gary Schlosberg
26 Nov 2013, 9:54 AM
Perhaps this thread will help:
http://www.sencha.com/forum/showthread.php?266288