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
Trusted Contributor
Posts: 141
Registered: ‎02-15-2012
My Device: 9800
My Carrier: Airtel
Accepted Solution

Cursor is not moving when entering text

I am usuing edit field, but when I type any text in this field, then cursor in not moving with the text, It is showing typed text, but cursor position still remains on start .

 

I am using Os 6 and Os 7/7.1.

 

Please let me know for the problem.

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

Re: Cursor is not moving when entering text

and you did not modify the field at all?
----------------------------------------------------------
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
Trusted Contributor
Posts: 141
Registered: ‎02-15-2012
My Device: 9800
My Carrier: Airtel

Re: Cursor is not moving when entering text

Hi simon,

                    I got the solution for it, I have modify the cursor by using following code in onFocus and onUnFocus methods:

 

setCursorPosition(getText().length())

invalidate();

return super.onFocus(direction); // For onUnfocus method

 

return super.onUnFocus(); // For unfocus method

Highlighted
Trusted Contributor
Posts: 141
Registered: ‎02-15-2012
My Device: 9800
My Carrier: Airtel

Re: Cursor is not moving when entering text

Hi simon,

                    I got the solution for it, I have modify the cursor by using following code in onFocus and onUnFocus methods:

 

setCursorPosition(getText().length())

invalidate();

return super.onFocus(direction); // For onfocus method

 

return super.onUnFocus(); // For onunfocus method