We want to use a SpinnerItem that will only allow [-1000 .. 1000].
We are not setting a default value because this form field is optional.
We want the SpinnerItem to have a validation error whenever a value is not in the acceptable range.
The problem we have is the following:
if a user types (or pastes) a NON-numerical value, isc.SpinnerItem.updateValue() will silently ignore the invalid value and revert to the previous value.
I attached a screenshot of our form to this post to illustrate why this behaviour is problematic for us:
- There is a single field in the form.
- If the user types "abc" in the spinner item's text box, he keeps the focus in the spinner item text field _AND_ he uses his mouse to click on the "Save" button; it will NOT be possible for the user to know the value he input has been ignored.
We're quite reluctant to override updateValue() because this is likely to break in a future version.
PS: We tried using "keyPressFilter" on the spinner item, but it won't work because we must support negative values and we had to use "[\-0-9]" as the regex. This ended up allowing the user to input "---1--" in the text field.
What would be your proposal to fix the problem ?
Thanks !
SmartClient version: v9.0p_2013-12-03/Pro Deployment (built 2013-12-03)
We are not setting a default value because this form field is optional.
We want the SpinnerItem to have a validation error whenever a value is not in the acceptable range.
The problem we have is the following:
if a user types (or pastes) a NON-numerical value, isc.SpinnerItem.updateValue() will silently ignore the invalid value and revert to the previous value.
I attached a screenshot of our form to this post to illustrate why this behaviour is problematic for us:
- There is a single field in the form.
- If the user types "abc" in the spinner item's text box, he keeps the focus in the spinner item text field _AND_ he uses his mouse to click on the "Save" button; it will NOT be possible for the user to know the value he input has been ignored.
We're quite reluctant to override updateValue() because this is likely to break in a future version.
PS: We tried using "keyPressFilter" on the spinner item, but it won't work because we must support negative values and we had to use "[\-0-9]" as the regex. This ended up allowing the user to input "---1--" in the text field.
What would be your proposal to fix the problem ?
Thanks !
SmartClient version: v9.0p_2013-12-03/Pro Deployment (built 2013-12-03)
Comment