quixit
1 May 2009, 7:55 AM
After uploading a file with a BasicForm and option fileUpload = true, the given XML result won't be proccessed.
imho the problem is, that in snippet 1 the response is only processed with a given responseText. In snippet 2 responseText is initialized with an empty string, but if the server answers XML, the responseText wont be be touched, so its still empty and afterwards it wont be processed.
Same Problem is in 2.2 and was discussed in
http://extjs.com/forum/showthread.php?t=6076
Snippet 1 source/widgets/form/Action.js line 200:
// private
processResponse : function(response){
this.response = response;
if(!response.responseText){
return true;
}
this.result = this.handleResponse(response);
return this.result;
},
snippet 2 source/data/core/Connection.js line 142:
function cb(){
var me = this,
// bogus response object
r = {responseText : '',
responseXML : null,
argument : o.argument},
doc,
firstChild;
try {
doc = frame.contentWindow.document || frame.contentDocument || WINDOW.frames[id].document;
if (doc) {
if (doc.body) {
if (/textarea/i.test((firstChild = doc.body.firstChild || {}).tagName)) { // json response wrapped in textarea
r.responseText = firstChild.value;
} else {
r.responseText = doc.body.innerHTML;
}
} else {
responseXML = doc.XMLDocument || doc;
// with XML we are here, and responseText is still empty
}
}
}
catch(e) {}
imho the problem is, that in snippet 1 the response is only processed with a given responseText. In snippet 2 responseText is initialized with an empty string, but if the server answers XML, the responseText wont be be touched, so its still empty and afterwards it wont be processed.
Same Problem is in 2.2 and was discussed in
http://extjs.com/forum/showthread.php?t=6076
Snippet 1 source/widgets/form/Action.js line 200:
// private
processResponse : function(response){
this.response = response;
if(!response.responseText){
return true;
}
this.result = this.handleResponse(response);
return this.result;
},
snippet 2 source/data/core/Connection.js line 142:
function cb(){
var me = this,
// bogus response object
r = {responseText : '',
responseXML : null,
argument : o.argument},
doc,
firstChild;
try {
doc = frame.contentWindow.document || frame.contentDocument || WINDOW.frames[id].document;
if (doc) {
if (doc.body) {
if (/textarea/i.test((firstChild = doc.body.firstChild || {}).tagName)) { // json response wrapped in textarea
r.responseText = firstChild.value;
} else {
r.responseText = doc.body.innerHTML;
}
} else {
responseXML = doc.XMLDocument || doc;
// with XML we are here, and responseText is still empty
}
}
}
catch(e) {}