I have code to rollback changes in the UI if the user press the Cancel button.
To do so, I remember all values at the beginning and I call set_value(OldValue)
when required. It works except in one case for the RadNumberTextBox...
When the RadNumberTextBox is always enable then it works. But I have a case where a RadNumberTextBox is enabled if a check box is checked, so it's possible that the text box was enabled and now be disabled...I have to re-enable it and set back it's original value.
With these steps:
- Original state: the text box is enabled with a value (e.g. 20)
- 1: the user changed the value to 15
- 2: the user uncheck the check box...I disable the text box with the set_enabled(false) method
- 3: the user press the Cancel button...I re-enable the text box and I try to set back the value to 20
The result is: the value remains to 15!
Even if I try again to set back the value with set_value(20) it doen't work. But if the user put the focus on the text box, and without changing anything he click again on the Cancel button, then the set_value(20) works!
By tracing the javascript code while I am calling the set_value() method, I notice that the _initialValueAsText property contains the very first value (20) and not the current value (15), and this property is compared to the new value to know is something need to be changed...the answer is NO CHANGE but in fact it must be. When the user put the focus on the text box then the _initialValueAsText property contains the good value which is the value we see on the screen (15).
As a patch, I assign the value of _lastSetTextBoxValue (which contains the good value) in _initialValueAsText and then when I call set_value, the comparaison found a change without having the user to click on the text box...
Can I expect a fix on that?
When the RadNumberTextBox is always enable then it works. But I have a case where a RadNumberTextBox is enabled if a check box is checked, so it's possible that the text box was enabled and now be disabled...I have to re-enable it and set back it's original value.
With these steps:
- Original state: the text box is enabled with a value (e.g. 20)
- 1: the user changed the value to 15
- 2: the user uncheck the check box...I disable the text box with the set_enabled(false) method
- 3: the user press the Cancel button...I re-enable the text box and I try to set back the value to 20
The result is: the value remains to 15!
Even if I try again to set back the value with set_value(20) it doen't work. But if the user put the focus on the text box, and without changing anything he click again on the Cancel button, then the set_value(20) works!
By tracing the javascript code while I am calling the set_value() method, I notice that the _initialValueAsText property contains the very first value (20) and not the current value (15), and this property is compared to the new value to know is something need to be changed...the answer is NO CHANGE but in fact it must be. When the user put the focus on the text box then the _initialValueAsText property contains the good value which is the value we see on the screen (15).
As a patch, I assign the value of _lastSetTextBoxValue (which contains the good value) in _initialValueAsText and then when I call set_value, the comparaison found a change without having the user to click on the text box...
Can I expect a fix on that?