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
Developer
gibli
Posts: 44
Registered: ‎03-10-2009
My Device: Not Specified
Accepted Solution

Extending BasicEditField

Hi,

 

I want to create my own implementation of BasicEditField that will limit the numbers of characters entered.

In short I just want to implement a way to set the maxLength.

 

Currently, inside keyChar(..), I am counting the number of characters and return false if the max has been reached.

Is this the only solution ?

 

Thanks

 

 

Please use plain text.
Developer
Posts: 432
Registered: ‎02-23-2009
My Device: Not Specified

Re: Extending BasicEditField

You can use this constructor of BasicEditField

 

BasicEditField (String label, String initialValue, int maxNumChars, long style)

 

where maxNumChars is max. number of characters.

 

 

 


Press the kudos button to thank the user who helped you.

If your problem was get solved then please mark the thread as "Accepted solution".

 

 

Deepesh Gupta
Please use plain text.
Developer
gibli
Posts: 44
Registered: ‎03-10-2009
My Device: Not Specified

Re: Extending BasicEditField

Thanks. Didn't see that.
Please use plain text.