mabello
9 Oct 2009, 4:09 AM
Hi there,
I just want to discuss the possibility to have a misbehaviour due to this small piece of code taken from the Field class, in particular due to {buffer:10}
initEvents : function(){
this.el.on(Ext.isIE || Ext.isSafari3 ? "keydown" : "keypress", this.fireKey, this);
this.el.on("focus", this.onFocus, this);
// fix weird FF/Win editor issue when changing OS window focus
var o = this.inEditor && Ext.isWindows && Ext.isGecko ? {buffer:10} : null;
this.el.on("blur", this.onBlur, this, o);//It will fire the change event of the combo for example
},
I have already discuss the problem months ago, I think with Condor in which this code will bring to a bug in the following situation:
1. The change event of a combobox is used to save a value of the combo in an underlying JSON object.
2. I have a From Panel with a Save button in a Toolbar in which I specified a handler to send the underlying JSON object to the server
3. I change the value of the combobox but it keeps the focus so that the change event does not fire yet.
4. I press "too" quickly the Save button, the change event will be fired after the handler attached to the Save button is executed because the 10ms of buffering, so the change event will be missed, ergo problem in your code since the underlying JSON won't have the selected value of the combobox.
Not sure this is clear, but it can bring to a very subtle bug in that case
Cheers
I just want to discuss the possibility to have a misbehaviour due to this small piece of code taken from the Field class, in particular due to {buffer:10}
initEvents : function(){
this.el.on(Ext.isIE || Ext.isSafari3 ? "keydown" : "keypress", this.fireKey, this);
this.el.on("focus", this.onFocus, this);
// fix weird FF/Win editor issue when changing OS window focus
var o = this.inEditor && Ext.isWindows && Ext.isGecko ? {buffer:10} : null;
this.el.on("blur", this.onBlur, this, o);//It will fire the change event of the combo for example
},
I have already discuss the problem months ago, I think with Condor in which this code will bring to a bug in the following situation:
1. The change event of a combobox is used to save a value of the combo in an underlying JSON object.
2. I have a From Panel with a Save button in a Toolbar in which I specified a handler to send the underlying JSON object to the server
3. I change the value of the combobox but it keeps the focus so that the change event does not fire yet.
4. I press "too" quickly the Save button, the change event will be fired after the handler attached to the Save button is executed because the 10ms of buffering, so the change event will be missed, ergo problem in your code since the underlying JSON won't have the selected value of the combobox.
Not sure this is clear, but it can bring to a very subtle bug in that case
Cheers