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
Posts: 192
Registered: ‎01-12-2010
My Device: Bold
Accepted Solution

displaying data in table format

Dear,

I followed the example on

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800505/800508/...

 

which really helped me to solve ny problem.

 

now my data is displaying but its displaying twice.

 

below is my code to display data.

 

     
         for (int count = 0; count < 4; ++count)
         {
             rows[count] = new VerticalFieldManager(VerticalFieldManager.NO_HORIZONTAL_SCROLL |
                 VerticalFieldManager.NO_VERTICAL_SCROLL);
            
             //Add 21 rows of data to the column
             displayData=this.split(data, '|');
             for (int rowCount = 0; rowCount < displayData.length ; ++rowCount)
             {
            
                 sb.delete(0, sb.length());
                 //sb.append("Data ");
                 //sb.append(count);
                 //sb.append(" , ");
                 //sb.append(rowCount);
                // sb.append("  ");
                // sb=String(displayData[rowCount]);
                 //displayData[rowCount]=sb.toString();
              
                
              sb.append(displayData[rowCount]);//, 0, rowCount);//displayData[rowCount]);
              sb.append("|");    
              
                rows[count].add(new LabelField(sb.toString(), LabelField.FOCUSABLE));
             }
             // Add the row to the rowHolder.
              rowHolder.add(rows[count]);
      }
        
         dataScroller.add(rowHolder);
         add(dataScroller);    

please help

 

rgds

Nadir

Developer
Posts: 19,612
Registered: ‎07-14-2008
My Device: Not Specified

Re: displaying data in table format

I think you wil find that this code gives you better results:

 

How To - Create a rich UI layout with TableLayoutManager
Article Number: DB-00783
http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800505/800508/...

 

There is also a blog about this Manager:

http://supportforums.blackberry.com/t5/BlackBerry-Developer-s-Blog/How-to-use-Table-View-layout/ba-p...

Developer
Posts: 192
Registered: ‎01-12-2010
My Device: Bold

Re: displaying data in table format

thanks a lot peter this one really helped me

Contributor
Posts: 37
Registered: ‎10-15-2010
My Device: Not Specified

Re: displaying data in table format

Hi guys? could someone explain how do i update the table fields??

 

i wanna didplay infos based on a user.

 

If User X  login, i display his favoirite movie names in a table (using table layout manager.) from a vector. but my problem is when the USER x logs out the table still shows the movies. I made sure the vector is empty. when USER Y login, he still see the User X movies eventhough the vector contains the movies of User Y.

 

I think, i need to invalidate the field but it stil not working...Could someone please direct me in right direction..

Thanks guz in advance.

Contributor
Posts: 37
Registered: ‎10-15-2010
My Device: Not Specified

Re: displaying data in table format

anyonae???????

Developer
Posts: 713
Registered: ‎05-31-2010
My Device: 8520

Re: displaying data in table format

You have to update the fields inside the cells of the TableLayout. You can do something like:

 

((LabelField) outerTable.getField(0)).setText("your new value")

Contributor
Posts: 37
Registered: ‎10-15-2010
My Device: Not Specified

Re: displaying data in table format

thanks guys!!! this is an awesome fourm.. quick replies:smileyhappy: