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

BlackBerry® World™ Development

Reply
Developer
Posts: 216
Registered: ‎02-18-2010
My Device: 9350,8520
My Carrier: no

Re: how to create a table ?

[ Edited ]

add the following code after adding the GridFieldManager (gfm).

 

 

XYEdges edges = new XYEdges(1, 1, 1, 1); 
Border Border = BorderFactory.createSimpleBorder(edges);
	    
 for(int i=0;i<gfm.getFieldCount();i++)
  {
    gfm.getField(i).setBorder(Border);
  }

 

 

Regular Contributor
Posts: 61
Registered: ‎11-08-2010
My Device: Not Specified

Re: how to create a table ?

Hi,

 

      Thank you for your reply....i tried the code which you gave as a reply...its working but the output was not in a tabular view format....i need my rows and column to be shown in the table manner..

 

 

 

With regards

Sunil

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Developer
Posts: 216
Registered: ‎02-18-2010
My Device: 9350,8520
My Carrier: no

Re: how to create a table ?

You can override 

 

 

public int getPreferredWidth() {
 return 80;
 }

 

for the label field or use Custom LabelField instead of labelField

like:

 

 

import net.rim.device.api.ui.component.LabelField;

public class CustomLabelField extends LabelField{
	public CustomLabelField(String text) {
		super(text);
	}
	public int getPreferredWidth() {
		return 80;
	}

}

 and decide the equal size for each block of table.

table.jpg

 

Regular Contributor
Posts: 61
Registered: ‎11-08-2010
My Device: Not Specified

Re: how to create a table ?

Hi,

    

        If you dont mind  can you please explain me a little bit in details .

 

With Regards

Sunil

Developer
Posts: 216
Registered: ‎02-18-2010
My Device: 9350,8520
My Carrier: no

Re: how to create a table ?

please specified what u want to explain.

Do u have any problem to use above code?

New Developer
Posts: 3
Registered: ‎11-30-2010
My Device: Not Specified

Re: how to create a table ?

hi,

       Am a beginner to this BlackBerry applications....Need to display my datas in the Table like you have shown in the sample simulator...Can you please send me any "link" so that i can get a output like that..

 

Thanks in Advance

 

With Regards

Deva

Developer
Posts: 216
Registered: ‎02-18-2010
My Device: 9350,8520
My Carrier: no

Re: how to create a table ?

I used below link to create table 

 

http://supportforums.blackberry.com/t5/BlackBerry-App-World-Development/how-to-create-a-table/td-p/5...

 

by some changes which given in same thread.

 

But some problem occur with this. 

You can try to remove that problem.

Developer
Posts: 100
Registered: ‎01-13-2011
My Device: Not Specified

Re: how to create a table ?

I have several rows in my gridFieldManager, so they only appear first rows which can fit in the screen, what could I do to make rest of rows appear.

Trusted Contributor
Posts: 204
Registered: ‎07-03-2011
My Device: Torch
My Carrier: Digicel

Re: how to create a table ?

Hi I have implemented my code, but there are still spaces between the lines so that they just look like individual squares on the screen. Is there any way to make the borders run into each other like in your diagram.
_______________________________________________________
Never be close-fisted with the knowledge you've received. For if others were the same to you, you would not be painted as the person you are; the flowing definition of you, would be non existent.

You would be meaningless.
Highlighted
Visitor
Posts: 1
Registered: ‎03-08-2012
My Device: BB-Storm
My Carrier: Airtel

Re: how to create a table ?

[ Edited ]

Your code for table creation is good. I searched and tried a lot of codes but only this one works fine. I wish to adjust the left and right side margins of the table so that the table will be looking at the centre with some spaces on its either side. Please provide the code for this adjustment. I tried gfm.setMargin() method but only the left margin was adjusted not the right margin.Thank you