Table rows height set much too small

Hi guys,

I’m just dealing with a very very basic example of Vaadin but it’s just not working: I wanna display some items in a table, without bean container and stuff like this, just 20 items in a table…but the row height is set much too small and I can not see any item. I can see it does “something” as there is a number of rows in the table but I cant see any contents.

Can you help me please?

@AutoGenerated
private VerticalSplitPanel buildVerticalSplitPanel_1()
{
// common part: create layout
verticalSplitPanel_1 = new VerticalSplitPanel();
verticalSplitPanel_1.setImmediate(false);
verticalSplitPanel_1.setWidth(“100.0%”);
verticalSplitPanel_1.setHeight(“100.0%”);
verticalSplitPanel_1.setMargin(false);

	// table_1
	table_1 = new Table();
	table_1.setWidth("100.0%");
	table_1.setHeight("100.0%");
	
	verticalSplitPanel_1.addComponent(table_1);
	
	// populate table
	table_1.addContainerProperty("ID",       Integer.class, null);
	table_1.addContainerProperty("First Name", String.class,  null);
	table_1.addContainerProperty("Last Name",  String.class,  null);
	
	for (int i=0; i<10; i++)
	{
		table_1.addItem(new Object[] {new Integer(i),"FirstName_"+i,"LastName_"+i});
	}
	
	return verticalSplitPanel_1;
}

Thanx in advance, Florian
11977.png

The problem is probably here:

table_1.addItem(new Object[] {new Integer(i),"FirstName_"+i,"LastName_"+i})

The one-parameter addItem(Object) takes an item ID as a parameter, which is probably not what you intended. The special addItem(Object,Object) conveniency method in Table takes a property value array
and
an item ID. The index value works nicely as an item ID, so you should just add “i” parameter in the call:

table_1.addItem(new Object[] {new Integer(i),"FirstName_"+i,"LastName_"+i}, i)

whao, you just saved my day! Works perfectly…

Thanx!