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

New Developer
Posts: 4
Registered: ‎02-10-2010
My Device: Storm 2
Accepted Solution

List Problem..



I am trying to implement lists. I have used listfield to show the contents on another screen in a list.. Now i want to select one of them and on clicking them i want the details of that item.. what should i use ?? Please help..



Posts: 571
Registered: ‎04-11-2009
My Device: BB 10 Dev Alpha

Re: List Problem..

[ Edited ]

Hi oahuja,


You will have to :


1) Override navigationClick() for the list.

2) You can find the index of the list item by getSelectedIndex().

3) With the help of this index you can display the rest details of the list on other screen.


Hope it gives u a direction. All the best.

Kanak Sony
http://dodevelopnshare.wordpress.com/ | http://www.linkedin.com/profile/view?id=188131481&trk=tab_pro
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: List Problem..

Two other options:


Assume you are using MainScreen, then the click will create a menu by going through makeMenu.  So you can:


a) Have code in makeMenu to check the Field in focus and, if it is your ListField, get the SelectedIndex and add a (default) Display menu option that will take you user into your display screen


b) As above, but rather than overriding makeMenu provide you ListField specific menu items in a contextmenu.  Again the user selects a menu item to get more details ( or another menu item to delete the entry, if that is possible). 


You can choose the option that is the best fit for your application.