A have a slight problem with using the Grid Details view. I have a DetailsGenerator which creates a HorizontalLayout with two components: a Label and a Table. When the detail row is open, it does not show the table component. Looking at the HTML, all the correct elements seem to be in place, but the table body wrapper div has heigth and width of zero pixels.
It seems like the detail element gets some fixed size, how do we decide the size of the detail container? Could this be some kind of timing problem that the detail component is not aware of the size of the components inside the layout?
@Override
public Component getDetails(Grid.RowReference rowReference) {
HorizontalLayout layout = new HorizontalLayout();
layout.setSpacing(true);
layout.setMargin(true);
String text = "some label text";
Label label = new Label(text);
layout.addComponent(label);
Table table = new Table("TABLE");
table.addContainerProperty("column1", String.class, null);
table.addContainerProperty("column2", String.class, null );
table.setColumnHeader("column1", "COLUMN1");
table.setColumnHeader("column2", "COLUMN2");
table.addItem(new Object {
"testing column1",
"testing column2"},
new Integer(0));
layout.addComponent(table);
return layout;
}
Did you resolve this problem? We have very similar situation that table is not drawn when detail is opened. When opening details for another row then the previous one is drawn but it still doesn’t take the space that it needs.
not as such I created a “custom table” with Vertical and Horizontal layouts to display my “table”.
However, I think they have done some fixes for the Grid Detaild view in Vaadin version 7.6.2, have you tried that version? At least in the release notes they say they have fixed something for GridLayout in detail view, so maybe you could use that instead of a Table component, if that still doesn’t work?
As Ilya mentioned in the other thread, we had a related fix in 7.6.2 and now more components should work in the details generator. If you encounter further problems, please report them so we can fix them
Was there still something off with this Table case?
I think at least the table and gridlayout components started to work. Table component was what we wanted at the start. I also quickly tested the example that Marika posted and that too started to work when I set some height and width to the table. Not sure if that is a bug or not?
-Simo
One thing that I noticed is that table doesn’t draw scrollbar if it is inside Grid’s Detail. Here is sample program where table is in Details and no scrollbar. And also same table inside HorizontalLayout where scrollbar is shown.