I seem to be encountering problems with numeric stepper values over several billion. It is hard to say where the exact break line is, but I have suddenly begun receiving bug reports from users who are 'winning the resource wars' in my application.
City has 120Bn gold, 7bn food, 600M wood, 600m stone, 700m iron
1: Clean open of the0bot
2: Wait a few mins for everything to process
3: open TB5
4: values auto displayed in gold window are: -429129244 (s/b 0)
5: Click "Clear", "Refresh"
6: Gold now cleared but this displayed in Food: 1448289086
7: NB: No troops have been selected yet
There are 5 steppers in a group, the individual limit for any control is variable, set by the formula
control.maximum = (totalGroup.maximum - totalGroup.value) + component.value)
Since the practical limit in the application is actually 999,999,999 I can modify the code to work, but the API says: Maximum value of the NumericStepper. The maximum can be any number, including a fractional value.
Here is the issue: when set value outside of the range and click a “submit” button, the value is automatically changed and submitted. And customer complains they even do not realize it’s out of range and there should be an error message to remind them.
But I found it’s hard to handle it.
Do you have any suggestion on that?
you can use the testField property of the numeric stepper class to access changes to the textinput component part of the stepper.
you can use a stepper listener like focusin (and a loop) or focusout to check for changes to the textField of the stepper and display warnings and/or reset the textField's text property.