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

Posts: 34
Registered: ‎10-03-2012
My Device: 9300
My Carrier: cell c
Accepted Solution

FieldList selection


Iam trying to select items from a list.
I created the list using the following code.

MyList= new ObjectListField();

My problem is how do I select the items in mylist. Thank you in advance.
Posts: 17,025
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: FieldList selection

i assume you have the list displayed on the screen and are contempt with that?

there is no direct accessor method in the API, usually you use navigationClick for it.
use getSelectedIndex to retrieve the index of the clicked object, and get the object from your array.
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
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: FieldList selection

ListField does not generate events on clicks, which is typically what you want to get a selection.  This code might help:




then you can, in your change listener, use the getSelectedIndex to find out which of your entries was in focus. 


Hopefully that will get you going.