10-18-2012 12:15 PM
Hi
I am working on a BB10 app using Cascades. On one of my text fields I need to prevent all non numeric key presses allowing 0 - 9 and a decimal point. i have set the inputmode to phone and punctuation but obviously that still allows for other keys. The only way I can think of doing this is by checking the text 'onTextChanging' and remove any non numeric character.
Is there a better way?
Solved! Go to Solution.
10-18-2012 03:16 PM
So NumbersAndPunctuation doesnt work? Or are you using Phone and something else.
10-18-2012 04:41 PM
Numbers and Punctuation works but you can still type other characters such as # plus you can navigate back to the alpha keyboard. I need to trap key presses and prevent non numeric keys.
10-24-2012 04:48 AM
10-25-2012 12:35 PM
Facing the same problem and no idea too.
I need input for floating point numbers(digits, dot, comma).
In AIR SDK it was possible to assign a string to a TextField witch contains the restricted / nonrestricted keys.
Nothing similar here. I tried "onTextChanged" to evaluate the text after input by a Regular Expression and changing it if necessary. Unfortunally changing the text triggers the signal too - so an endless loop is created.
10-27-2012 06:50 AM
I have searched and searched for an answer to this but am getting no where. The only solution I have come up with is to scan what has been entered after the event and then remove any invalid characters. This looks and feels very unprofessional though.
I was hoping there would be a KeyPress signal or something related to the keyboard but as yet I havent found one.
Hoping BlackBerry will chime in here ![]()
10-27-2012 01:26 PM
the Roadmap says that Keyboard Support will be coming with C6 in December
11-05-2012 05:13 AM
Hi SlashKyle
Sorry for the delay, I have been on holiday.
The roadmap states:
"SDK updates to support the new 720x720 screen resolution and physical keyboard integration. UI controls are updated and resized to perfectly fit the square 720x720 screen, and will support keyboard shortcuts for efficient interaction and navigation."
So this is really just support for the new physical keyboard. Maybe they will include additional functionality but I was hoping someone would have come across this.
Still open to suggestions ![]()
11-12-2012 09:51 AM
Hi theappspod,
Could you please let me know how did you manage to get that "unprofessional" way to remove the text that you don't want from the TextField? I think I could use it as a workaround till RIM comes up with a "professional" way to do it.
Thanks so much
Regards
11-12-2012 10:31 AM
Hi ICaro
unfortunately the problem persists. I have not found away round this yet. I am hoping that RIM will address the issue this month though - fingers crossed.