PDA

View Full Version : success versus failure when there's an iframe in the house



bimargulies
21 Jul 2012, 2:46 PM
Using 4.1:

I create a form with:



xtype:'form',
title:'Test Form (fileupload) for Document View',
width: '100%',
url: bt_wd40_appurl + "/docView/documentViewMultipart",
items:[
{
xtype:'fileuploadfield',
name:'data',
anchor: '100%',
fieldLabel:'File to process'
},
{
xtype: 'hiddenfield',
name: 'options'
}
]


and in a button handler, I call submit.

If the server returns an error, the extjs runtime tries to call the 'success' handler. Then it gets an exception when it tries to decode an empty string as json.

Is this expected? Is there a recommended way of setting up errors on the server side to cope?

Worse yet, success maps to failure!

Success passes to line 43113 of ext-all-debug-with-comments.js, which passes the response to this.processResponse. Since what I return does not include a field names 'success', it fails. I'll add a field named success, but where did I miss the doc insisting on this?

scottmartin
30 Jul 2012, 9:34 PM
When you have a callback:



success: function(){
// get success or failure sent from server; planned response
}
failure: function(){
// server did not respond, ajax timeout .. call failure; unplanned
}


Scott