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 Developer
Posts: 2
Registered: ‎06-16-2009
My Device: Not Specified

Start and End Index of Selection in an EditField?

Is this a stupid question? I can't seem to find this anywhere!

 

Apparently there are depricated functions in the net.rim.device.api.ui.component.EditField: getSelectionStart() and getSelectionEnd()... 

 

So: how can I get the start and end index of a selection in an edit field?

 

Any help is greatly appreciated!!

 

Steve

Developer
Posts: 238
Registered: ‎08-26-2008
My Device: Not Specified

Re: Start and End Index of Selection in an EditField?

Hi,

 

isSelecting

isSelectionCopyAble

selectionCopy

 

should solve your needs.

 

Regards,

Jochen

New Developer
Posts: 2
Registered: ‎06-16-2009
My Device: Not Specified

Re: Start and End Index of Selection in an EditField?

Thanks Jochen...

 

I was able to work around the problem using the functions you described, but isn't it a little silly to have to copy a selection to the system clipboard just to find the start and end positions of a selection within an edit field?  It feels more like a workaround then a solution.

 

Why did Blackberry get rid of the getSelectionStart and End functions?

 

 

Developer
Posts: 104
Registered: ‎08-03-2010
My Device: Blackberry Z10
My Carrier: Idea

Re: Start and End Index of Selection in an EditField?

[ Edited ]

hey russosv 

 

In the AccessibleText Interface , You can find what u want?? Check this link it will give the Start offset and end offset of selection Text..

 

http://www.blackberry.com/developers/docs/6.0.0api/net/rim/device/api/ui/accessibility/AccessibleTex...


Please mark posts as solved if you found a solution.
Feel free to press the kudos button to thank the user that helped you