PDA

View Full Version : [4.0.7] requestexception not called on form submit with uplaod



Werzi2001
25 Mar 2012, 2:15 AM
Hi,

i have the problem that the event "requestexception" is not triggered on form submit if the form is submitted using the upload method (hidden iframe). Is this intended behaviour or a bug? Here some example code to show the problem:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="stylesheet" type="text/css" href="/resources/frontend/extjs/resources/css/ext-all-gray.css"/>
<script type="text/javascript" src="/resources/frontend/extjs/ext-all.js"></script>
<title>Test</title>
</head>
<body>
<script type="text/javascript">
Ext.onReady(function() {
Ext.util.Observable.observe(Ext.data.Connection);
Ext.data.Connection.on('requestexception', function(conn, response, options) {
alert('connection failure called');
});

var formpanel = Ext.create('Ext.form.Panel', {
renderTo: document.body,
/* if upload is active connection failure is not called
hasUpload: function() {
return true;
},
*/
items: [{
xtype: 'textfield',
fieldLabel: 'Test'
}],
buttons: [{
text: 'submit',
listeners: {
click: function(button, e, eopts) {
formpanel.getForm().submit({
url: '/url_that_causes_an_http_code_ne_200_and_success_false_in_json',
failure: function(form, action) {
alert('form failure called');
}
});
}
}
}]
});
});
</script>
</body>
</html>

I have some general exception handling for all ajax requests and some special handling for form submits. The form submits sometimes are uploads and sometimes not. The fact that the general handling is not called for upload submits would make it quite hard for me to handle exceptions.

Thanks for your help.

Yours
Thomas

mitchellsimoens
25 Mar 2012, 6:23 AM
This is intended as the upload doesn't support everything you get from an Ajax call.

Werzi2001
25 Mar 2012, 6:27 AM
Thanks for your reply. Sadly i had to expect this answer.