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
Contributor
Posts: 24
Registered: ‎01-24-2011
My Device: 4.2.1(8800), 4.6(9000), 4.7 and above

getCursorPosition() doesn't work for AutoCompleField - Issue

I've a CustomAutoCompleteField in which i am using paint() to display text and cursor.

However getEditField().getCursorPosition() does not work when the field is direcltly clicked on at a position in case of Touch devices.

Can anyone please tell me how to get the cursor position when the field gets clicked on?

 

Note:

>It works when you just scroll through the field though

> navigationClick(...) does not work for AutoCompleField

 

Developer
Posts: 729
Registered: ‎05-04-2011
My Device: 9700

Re: getCursorPosition() doesn't work for AutoCompleField - Issue

[ Edited ]

navigationClick is not activated on touch events.

 

The API you should use is touchEvent().

 

Using the input parameter you can get the X and Y of the touch.

 

E.