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
New Contributor
Posts: 2
Registered: ‎11-25-2010
My Device: Not Specified
Accepted Solution

Custom Edit field with overwrite option

I have created a custom edit field which can take 1 numeric character only.  If it already has a value when it receives the focus then I wish it to appear to be overwritten (not insert).  At the moment the user has to delete the character first.  Can any one help please?

Developer
Posts: 16,992
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Custom Edit field with overwrite option

welcome to the support forums.

 

you have several options, depending on your exact needs

- delete the text onFocus. deletes the text also when the user does not enter anything though, but you could set the text again onUnFocus

- overwrite keychar to check the input and set the text always to the entered character

----------------------------------------------------------
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
New Contributor
Posts: 2
Registered: ‎11-25-2010
My Device: Not Specified

Re: Custom Edit field with overwrite option

Thanks Simon.

 

Have just come up with a similar solution having viewed other threads. I used the keychar event to select the text already in  the field and then returned the entered  character.

 

Thanks for your help.