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: 26
Registered: ‎06-10-2011
My Device: Blackberry 9800 Simulator
My Carrier: Fledge Simulated Network
Accepted Solution

Parameters passing from Tavleview rows to next screen

[ Edited ]

Hello Blackberry Developers,


Simulator: BlackBerry 9800 Simulator
Simulator Ver:
JRE: 6.0.0


contacts01Contact Screen 1
So I am trying to construct a UI similar to Blackberry's Contact - An interface with focusable rows that triggers pushscreen. When a row is selected, the id (which is hidden from users) is passed to the next screen.

Contact Screen 2
The next screen pulls up record with the ID received from previous screen.


In my application, there can be more than just a single ID passed, certain screens passes several variables.

From the codes in article "Using TableModel, TableView, TableController and DataTemplate to Create a Selectab..., i figured that getLeafFieldWithFocus can retrieve the label of the focused button. However buttons are not suitable for my case due to appearance issues - I need different font styles and sizes in a row.
01 02Ideal Screen
This is exactly how I want my app to look like - user makes a category selection by touching the row, for example Food & Beverages.
The next screen shows all companies under Food & Beverages.

My Screen 1
I've built a tableview, with two columns and two rows. The last column is spanned across two rows:

TestDataTemplate theTemplate = new TestDataTemplate(theView, 2, 2);
theTemplate.createRegion(new XYRect(1,0,1,2));
theTemplate.createRegion(new XYRect(0,0,1,1));
theTemplate.createRegion(new XYRect(0,1,1,1));

And i've set the focus policy to rowfocus:

But now I'm stuck with how to pass the comID to the next screen. the comID will be hidden from users, it is shown here for debugging purposes only.


I can't find an easy way to do this yet, and after searching and looking at the api and forums, I am starting to think that the only way to do this is to construct a custom class. However I don't know which class to extend and which method to use for this purpose. Any help is greatly appreciated. Thanks in advance Smiley Wink


Posts: 26
Registered: ‎06-10-2011
My Device: Blackberry 9800 Simulator
My Carrier: Fledge Simulated Network

Re: Parameters passing from Tavleview rows to next screen



Although it wasnt as simple as I thought, I got exactly what I wanted!!


list Field


To those who are doing something similar, I got most of the info from Working with BlackBerry list fields – Tutorial, Simple ListField example and How To - Create a colour ListField. Cheers Smiley Happy