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
Posts: 1,474
Registered: ‎04-14-2009
My Device: Not Specified
Accepted Solution

How to create an edit field that auto-capitalizes the first character entered?

I need to create an edit field for entering names (first name, last name, etc.). I'd like the field to behave similar to how such fields behave when entering a new contact in the native Contacts application: the first character is automatically capitalized, however, if the user deletes the character and, without waiting too long, inputs another letter, the newly entered first character is not capitalized.

 

I could create such a field myself by creating a custom TextFilter, however, I simply cannot believe such a field is not readily available. Does anybody know if such field is readily available or can at least be easily created by small amount of customization of an existing class?

Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: How to create an edit field that auto-capitalizes the first character entered?

AutoTextEditField is what you are looking for.

 

 

Developer
Posts: 1,474
Registered: ‎04-14-2009
My Device: Not Specified

Re: How to create an edit field that auto-capitalizes the first character entered?

Thanks for the prompt reply! I'll give AutoTextEditField a try tomorrow morning and update the thread regarding the results.

Highlighted
Developer
Posts: 1,474
Registered: ‎04-14-2009
My Device: Not Specified

Re: How to create an edit field that auto-capitalizes the first character entered?

Thank you very much, RexDoug! AutoTextEditField is indeed exactly what I was looking for. To get the behavior like in the Contacts application, I constructed the field with the following flags: EditField.NO_NEWLINE | Field.EDITABLE | AutoTextEditField.NON_SPELLCHECKABLE.