This page was last modified 11:58, 16 April 2008.
Talk:KIJ000873 - Value of TextField.NUMERIC is limited to 10 digits in Series 40
From Forum Nokia Wiki
I think the problem is not only limited to the number of digits but to the value itself, too:
If you call setString(...) on a TextField constrained to TextField.Numeric and the numeric value exceeds Integer.MAX_VALUE then an IllegalArgumentException is thrown.
How to reproduce
TextField textField = new TextField("Enter Number:", "", 10, TextField.NUMERIC);
long n = Integer.MAX_VALUE;
textField.setString(Long.toString(n));
System.out.println("OK for Integer.MAX_VALUE, i.e. " + n);
try {
textField.setString(Long.toString(++n));
}
catch (IllegalArgumentException e) {
System.out.println("FAILED for Integer.MAX_VALUE + 1, i.e. " + n);
}
Thank you for your feedback. The article has been updated.
Forum Nokia KB 14:58, 16 April 2008 (EEST)
