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
tom_s
Posts: 73
Registered: ‎07-16-2008
My Device: Not Specified
Accepted Solution

Identifying the index with focus in custom listfield

I am trying to work with a custom listfield. I would like to know the index of the row that has focus, both for access from a screen menu and for possible highlight customization.

 

I thought this would be ListField.getSelectedIndex() but it looks like a row is selected only when you click it (or go into selection mode).

 

There doesn't seem to be a straightforward API for this unless I'm missing something?

 

Tom

 

Please use plain text.
Developer
mreed
Posts: 1,041
Registered: ‎07-16-2008
My Device: ಠ_ಠ

Re: Identifying the index with focus in custom listfield

[ Edited ]

ListField.getSelectedIndex() returns the row index with focus, -1 otherwise.

Do you have example code to provide?

Message Edited by mreed on 07-16-2008 03:40 PM
Please use plain text.
Developer
tom_s
Posts: 73
Registered: ‎07-16-2008
My Device: Not Specified

Re: Identifying the index with focus in custom listfield

Your response made me go look at the assumptions in my code again. Looks like user error. Thanks and sorry for taking your time.

 

-- Tom

Please use plain text.