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
peter_strange
Posts: 19,604
Registered: ‎07-14-2008
My Device: Not Specified

Re: Select entire row of table format display

Do you want to mark this as solved then?

Please use plain text.
Contributor
souravbasu2k
Posts: 15
Registered: ‎09-06-2010
My Device: Not Specified

Re: Select entire row of table format display

Yes, as far as I'm concerned it is solved. If something specifically can be done with the TableLayoutManager can  be seen.

 

 

Thanks.

Please use plain text.
Contributor
souravbasu2k
Posts: 15
Registered: ‎09-06-2010
My Device: Not Specified

Re: Select entire row of table format display

[ Edited ]

Sorry to bother you again, but I'm facing one problem.

 

When I use Screen.getLeafFieldWithFocus() to retrieve the ID of the row, it is returning "0" for all the rows. The same is not happening with the TableLayoutManager code.

 

Any thoughts ?

 

Please use plain text.
Developer
peter_strange
Posts: 19,604
Registered: ‎07-14-2008
My Device: Not Specified

Re: Select entire row of table format display

That is correct.  Since you have each row in a single HFM, the Bitmap is at the start.  You need to find the index of the HFM in its manager. 

 

To make this easier, you might like to add the HFMs into a specific VerticalFieldManager (VFM), that only contains rows.  Then the first row in the VFM will be index 0, second index 1 and so on. 

 

The code you will use will look something like this:

 

Field focus = <screen>.getLeafFieldWithFocus();

if ( focus instanceof BitmapField ) {

Manager m = focus.getManager();

,,,,,

index = m.getIndex();

}

 

There are other, perhaps better ways of doing this.  For example, you could use the Cookie Object associated with any Field to indicate the specific Field.

 

Hope this makes sense.

Please use plain text.
New Contributor
gdelgado
Posts: 2
Registered: ‎03-12-2009
My Device: Not Specified

Re: Select entire row of table format display

I tried using the TableLayoutManager and the FocusIndicatingHorizontalFieldManager without much success.

 

Here is what I've done

 

            TableLayoutManager testTable = new TableLayoutManager(new int[]
            {
                 TableLayoutManager. USE_PREFERRED_SIZE,
                 TableLayoutManager. USE_PREFERRED_SIZE,
                 TableLayoutManager.USE_PREFERRED_SIZE
             }, Manager.USE_ALL_WIDTH | Manager.HORIZONTAL_SCROLL | Manager.VERTICAL_SCROLL);
 
             for (int i =0; i < 10; i++) {    
                FocusIndicatingHorizontalFieldManager fihfm = new  FocusIndicatingHorizontalFieldManager(Manager.USE_ALL_WIDTH | Manager.HORIZONTAL_SCROLL  | Manager.VERTICAL_SCROLL);
                 LabelField labelField1 = new LabelField("test label 1");
                 fihfm.add(labelField1);
                 LabelField labelField2 = new LabelField("test label 2");
                 fihfm.add(labelField2);

                  LabelField labelField3 = new LabelField("test label 3");
                 fihfm.add(labelField3);

                 testTable.add(fihfm);
             }            
             add(testTable);

 

 

But the end result is 3 different tables next to each other, one with 3 columns and 4 rows

one with 3 columns and 3 rows and the other with 3 columns and 3 rows.

 

They are side by side instead of being one table with 10 rows. Notice that I added Horizontal and Vertical Scroll, as the data may make the table bigger than what can be display in the screen. 

 

Any ideas on what may be happenig?

 

Thanks,

Please use plain text.