Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Contributor
fonurr
Posts: 16
Registered: ‎02-24-2012
My Device: 8520
My Carrier: Turkcell

Problem with VirtualKeyboard

hello everybody,

 

I need an EditField which will represent "money amount" such as "1,159,540.85"

 

I set a filter by using setFilter() method and a TextFilter where only "0123456789.," are valid chars.

When the field is focused, VirtualKeyboard shows up with all keys are invisible except "." key  and if i press numeric button on keyboard, it shows the other chars  (0123456789,)   which is very hard to use.

 

I want "." key to be shown with other keys, or the numeric keyboard screen may be shown first to the user.

Is there a solution this? 

 

Thanks,

Onur

Please use plain text.
Developer
simon_hain
Posts: 15,806
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: Problem with VirtualKeyboard

welcome to the support forums.

i don't think you can control the virtualkeyboard. maybe a predefined filter works for you? FILTER_NUMERIC for example switches the virtual keyboard to numeric automatically i think.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Contributor
fonurr
Posts: 16
Registered: ‎02-24-2012
My Device: 8520
My Carrier: Turkcell

Re: Problem with VirtualKeyboard

Thanks for your reply Simon. I tried to use predefined filters, but they are not sufficient for many cases. For example FILTER_NUMERIC does not show "." and "," keys on Virtual Keyboard. It also does not let me add those keys to the EditField.

 

 

Please use plain text.
Developer
simon_hain
Posts: 15,806
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: Problem with VirtualKeyboard

if it is only a formatting issue you could use two fields, an editfield with FILTER_NUMERIC for the input, and a labelfield that is actually visible and produces the output as you want it.
i have used that trick on several occasions.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Contributor
fonurr
Posts: 16
Registered: ‎02-24-2012
My Device: 8520
My Carrier: Turkcell

Re: Problem with VirtualKeyboard

The user should be able to press "." key to enter the decimal part of the amount.

 

For example for writing 23.50 $, the user have to press "."

Please use plain text.
Super Contributor
bh1r1th
Posts: 273
Registered: ‎11-23-2010
My Device: 9800 torch
My Carrier: Software Programmer

Re: Problem with VirtualKeyboard

Please use FILTER_REAL_NUMERIC i think this will helps you.

Please use plain text.
Contributor
fonurr
Posts: 16
Registered: ‎02-24-2012
My Device: 8520
My Carrier: Turkcell

Re: Problem with VirtualKeyboard

and that brings about the problem of entering negative values :smileysad:

I can eliminate the minus sign on keyChar, but when the user long presses "i" key, it is not handled in keyChar event and minus sign appears. I don't know where it is handled. Where is it handled? :smileyhappy:

Please use plain text.