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

Native Development

Posts: 46
Registered: ‎02-22-2012
My Device: Developer
My Carrier: Various

Text input max length

The Gold SDK claims to support max text length limits on a text editor.


It appears this feature has only been added to a TextArea object instead of say at the AbstractTextControl level - with the consequence that single line text editors - a TextField object - still dont support a pretty basic requirement of limiting the text entered by a user.


Can anyone confirm a TextField still has no way of limiting the number of characters a user can enter ?

Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Text input max length

It's correct that the docs and header files don't have this.

Conceivable that the actual relevant code exists in the library, but I haven't checked that yet.

Likely you're right. :-(

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Posts: 146
Registered: ‎05-18-2012
My Device: PlayBook & STL100-1 LE Z10 & Dev Alpha C
My Carrier: Telefonica Spain

Re: Text input max length

Confirmed, the QML property  "maximumLength" only works with TextArea.

TextField rejects this property

Leandro Cerdan - Duantox Apps
BlackBerry Elite dev
TapyHold, Built for Blackberry multimedia scrapbook
Posts: 116
Registered: ‎10-31-2012
My Device: BB10 Dev Alpha B
My Carrier: -

Re: Text input max length

I wonder why they've done it that way? As you say, it's at the wrong level of inheritance.


The only solution for now will be to capture keypresses and do your own field validation I guess.

Posts: 263
Registered: ‎05-18-2011
My Device: Curve 9300, BB10 Dev Alpha C, Z10

Re: Text input max length

[ Edited ]

Where can we raise a request ticket for this feature?

While waiting for this feature, we can use a validator: https://developer.blackberry.com/cascades/documentation/ui/text/handling_input.html