Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Talk:Value of TextField.NUMERIC is limited to 10 digits in Series 40 (Known Issue)

From Wiki
Jump to: navigation, search

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)

 

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×