BlackBerry Forums Support Community               

Closed Thread
LinkBack Thread Tools
Old 07-08-2008, 10:36 PM   #1 (permalink)
Thumbs Must Hurt
Join Date: Oct 2007
Location: montreal
Model: 8100
Carrier: rogers
Posts: 70
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Best way to input decimal values on UI?

Please Login to Remove!

Hi there.

I wrote a little app that used NumericFieldChoice for the user to input a limited range of values. Thanks to members' help on this forum I completed and installed it on my Pearl. I then realized there was a bug when the user had to enter a decimal value. The range is anywhere from 0 to 3 in increments of .5.

After doing much reading I came to the conclusion that I can use only ObjectChoiceField or a simple EditField. I then converted that text to a number using Integer.valueOf(value1).intValue() in order to perform the necessary calculations. However I get this error:

cannot find symbol
symbol : method valueOf(net.rim.device.api.ui.component.EditField)
location: class java.lang.Integer

(Note that I'm aware that this is for integer values. I will change it to double when I resolve the error.)

My question is 1) am I on the right path using these fields for numeric input or is there a more efficient way and 2) why am I getting this error message?

Old 07-09-2008, 04:06 AM   #2 (permalink)
CrackBerry Addict
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Post Thanks: 0
Thanked 0 Times in 0 Posts

you tried to get the value of an editfield, try it with gettext() instead.
create the editfield with filter_numeric to avoid people entering letters.
java developer, Devinto, hamburg/germany
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Copyright 2004-2014
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.