BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 03-09-2009, 04:57 AM   #1 (permalink)
Thumbs Must Hurt
 
Join Date: May 2007
Location: berlin, germany
Model: 8310
PIN: N/A
Carrier: vodafone
Posts: 163
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default float edit field

Please Login to Remove!

hi,
if i create a new EditField I can say taht only numbers are allowed. But what is if I want to enter a float value, e.g. $34.45 ?

is there a filter, too?

thanks hibbert
__________________
My English is so bad, that makes me nobody so quickly after
Offline  
Old 03-09-2009, 08:47 PM   #2 (permalink)
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Post Thanks: 20
Thanked 77 Times in 68 Posts
Default

How about a BasicEditField with BasicEditField.FILTER_REAL_NUMERIC specified in the style.
Offline  
Old 03-13-2009, 04:32 AM   #3 (permalink)
Thumbs Must Hurt
 
Join Date: May 2007
Location: berlin, germany
Model: 8310
PIN: N/A
Carrier: vodafone
Posts: 163
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

hey,
ok, but is there a way to say that only 2 chars are allowed after the point??

thanks hibbert
__________________
My English is so bad, that makes me nobody so quickly after
Offline  
Old 03-13-2009, 04:46 AM   #4 (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
Default

you can use two fields, the second one with a max input length. or check the input programmatically, either after the input or using keychar to control it while typing.
__________________
java developer, Devinto, hamburg/germany
Offline  
Old 03-14-2009, 07:44 PM   #5 (permalink)
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Post Thanks: 20
Thanked 77 Times in 68 Posts
Default

Or you can write your own input filter.
Offline  
Old 03-16-2009, 05:45 AM   #6 (permalink)
Thumbs Must Hurt
 
Join Date: May 2007
Location: berlin, germany
Model: 8310
PIN: N/A
Carrier: vodafone
Posts: 163
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi,
working with two EditFields.... that's not what i'm searching for. using the keychar would be a way, but the idea to Write an won InputFilter sounds interesting. How do i do this?

hibbert
__________________
My English is so bad, that makes me nobody so quickly after
Offline  
Old 03-16-2009, 07:51 AM   #7 (permalink)
Thumbs Must Hurt
 
Join Date: May 2007
Location: berlin, germany
Model: 8310
PIN: N/A
Carrier: vodafone
Posts: 163
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

ok, i have found how to create my own InputFilter:
Code:
setFilter(new TextFilter(){
But I only want to accept numbers and ',' or '.'. And if the User presses the 'W'-Key, then a '1' should be written into the box, but i don't know how to do this.

maybe someone can help me

thanks hibbert
__________________
My English is so bad, that makes me nobody so quickly after
Offline  
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

CB Sciences Inc. Model ETH-200 Transducer Amplifier
$34.95
CB Sciences Inc. Model ETH-200 Transducer Amplifier pictureFrontRow 930R Pro Digital Teacher Amplifier
$0.99
FrontRow 930R Pro Digital Teacher Amplifier pictureFiber Optic Amplifier Autonics Dual Display Bf5r-D1-N New J
$87.9
Fiber Optic Amplifier Autonics Dual Display Bf5r-D1-N New J picture5Pcs Tl082 Tl082cdt So8 Op-Amp Jfet Op Amplifier Dual Opv 082C New Ic P
$0.99
5Pcs Tl082 Tl082cdt So8 Op-Amp Jfet Op Amplifier Dual Opv 082C New Ic P pictureTektronix AM 503B Current Probe Amplifier Calibrated 30 Day Warranty
$369.5
Tektronix AM 503B Current Probe Amplifier Calibrated 30 Day Warranty picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.