How to dynamic display table

I have two tables , The left table list some item information. when click each item, the right table will display related information. the right table have different container source and different column against left item. who has experience on this? I want to update table every time. but it doesn’t work .

for example, re-update table as below;

	table.addContainerProperty();
	table.setVisibleColumns();
	table.setColumnHeaders();
	table.setContainerDataSource();

But on browse have not any change . I want to know if there is a refresh method. Thanks your help.

Personally, I just make a new table and replace the old one with the new one.
Perhaps not the best way, but it works and is reasonably fast.

Thanks, I also use this method. but It doesn’t work. there is any not data display in table on browse. I don’t know why. Whether need to a special refresh method.

It might depend on your layout, etc.
In my prototype, I just have the table as a component of a split panel, so I just do: horizontalSplit.setSecondComponent( table );

I am using VerticalLayout, so I think whether I can do like this:

VerticalLayout View = new VerticalLayout();
View.removeComponent(Table);
re-create …
View.addComponent(Table);

I do it like this, when a row in the first table is selected:

  • grab data from selected row of table 1
  • create a new Container for table 2 and use data from row of table 1 for the selection
  • table2.setContainerDataSource()
  • table2.setVisibleColumns()
  • table2.setColumnHeaders()

That’s it. Good luck

Andreas

resolved it. just need to remove it and re-create .