BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 03-09-2009, 04:57 AM   #1
hibbert
Thumbs Must Hurt
 
Join Date: May 2007
Location: berlin, germany
Model: 8310
PIN: N/A
Carrier: vodafone
Posts: 163
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
hrbuckley
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Default

How about a BasicEditField with BasicEditField.FILTER_REAL_NUMERIC specified in the style.
Offline  
Old 03-13-2009, 04:32 AM   #3
hibbert
Thumbs Must Hurt
 
Join Date: May 2007
Location: berlin, germany
Model: 8310
PIN: N/A
Carrier: vodafone
Posts: 163
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
simon.hain
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
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
hrbuckley
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Default

Or you can write your own input filter.
Offline  
Old 03-16-2009, 05:45 AM   #6
hibbert
Thumbs Must Hurt
 
Join Date: May 2007
Location: berlin, germany
Model: 8310
PIN: N/A
Carrier: vodafone
Posts: 163
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
hibbert
Thumbs Must Hurt
 
Join Date: May 2007
Location: berlin, germany
Model: 8310
PIN: N/A
Carrier: vodafone
Posts: 163
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



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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


OEM IBM Wheelwriter Easystrike High Yield Correctable Film Ribbons 1299845 picture

OEM IBM Wheelwriter Easystrike High Yield Correctable Film Ribbons 1299845

$17.00



IBM Correctable Ribbon Cassette Black 1299300 NOS Original OEM picture

IBM Correctable Ribbon Cassette Black 1299300 NOS Original OEM

$2.99



Genuine IBM Selectrric Motor Bushing 10 Pack OEM  P/N 1236572 picture

Genuine IBM Selectrric Motor Bushing 10 Pack OEM P/N 1236572

$7.99



IBM CASH DRAWER KEY'S #9960 SET OF 2 KEYS. AFTERMARKET KEY'S SAME AS OEM 33G3360 picture

IBM CASH DRAWER KEY'S #9960 SET OF 2 KEYS. AFTERMARKET KEY'S SAME AS OEM 33G3360

$18.00



IBM Genuine OEM Printer Filler Wide Credit Card Holder 10N1259 picture

IBM Genuine OEM Printer Filler Wide Credit Card Holder 10N1259

$24.79



IBM WHEELWRITER TYPEWRITER TRANSPORT MOTOR Series II - OEM wheelwriter parts picture

IBM WHEELWRITER TYPEWRITER TRANSPORT MOTOR Series II - OEM wheelwriter parts

$28.00







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