PDA

View Full Version : Params of Ext.Ajax.Request ignored



alwin12
1 Aug 2010, 11:48 PM
Hello,

sometimes I get strange errors saving a textfield using Ext.Ajay.Request. It only occurs using Internet Explorer and then only randomly. The code is so simple, that i would expect it to work always. About once a day the fields "id" and "bemerkung" get completely ignored and saving fails, they're not even null.
Do you have an explanation?



DBHansi.Bemerkung = function(options) {

this.textarea = new Ext.form.TextArea({
value: options.text,
flex: 1
});

this.save = function() {
Ext.Ajax.request({
url: options.url,
params: {
id: options.id,
bemerkung: this.textarea.getValue()
},
success: function() {
},
failure: function() {
Ext.Msg.alert(
"Exception", "Fehler");
}
});
}.createDelegate(this);
}


I get Similar errors saving Data using Ext.data.JsonWriter. In that case nothing is passed to the server and i get NullPointerExceptions trying to parse the Json Data.

Condor
2 Aug 2010, 1:24 AM
Dangerous code. You should make a local copy of options before using it in save(), e.g.

DBHansi.Bemerkung = function(options) {
options = Ext.apply({}, options);
...
}