Hello Isomorphic team,
We would like to report what appears to be an unexpected input parsing issue when using SmartGWT IntegerItem.
Summary
Steps to Reproduce
Scope
We would like to report what appears to be an unexpected input parsing issue when using SmartGWT IntegerItem.
Summary
- IntegerItem accepts percentage-formatted input (e.g. 100%, 200%) and normalizes it to an integer value (1, 2), even when integer-only validation is applied.
- SmartGWT documentation for IntegerItem does not mention percentage handling or normalization.
- This can lead to incorrect persisted values without any user-facing error.
- SmartClient Version: v12.1p_2021-07-14/PowerEdition Deployment (built 2021-07-14)
- Mode: SuperDev
- Browser: Chrome Version 146.0.7680.178 (Official Build) (64-bit)
- OS: Windows 11
Steps to Reproduce
- Create a form field using IntegerItem
- Instantiate IsIntegerValidator() and setErrorMessage()
- Set IsIntegerValidator() to IntegerItem field
- Enter a value containing a percent sign, for example: 200%
- Save or read back the value
| Expected Result | Actual Result |
| Percentage-formatted values should be rejected | Input is accept |
| Display error message | 200% is normalized to 2 |
Code:
IntegerItem randomSamplingIntegerItem = new IntegerItem("randomSampling");
IsIntegerValidator integerValidator = new IsIntegerValidator();
integerValidator.setErrorMessage("An integer must be entered");
randomSamplingIntegerItem.setValidators(integerValidator);
Scope
- We verified that this behavior is not isolated to a single screen and occurs consistently across multiple IntegerItem fields within our application.
- Is percentage parsing and normalization considered intended behavior for IntegerItem?
- If not, is this a known issue or bug?
- What is the recommended approach to enforce strict integer-only input (disallowing % and other locale-based numeric formats)?