I use Vaadin (6.7.4) and this table (it is on a modal window) does not update the view.
First it was created with generated columns, but I read that it has problems with table update, so I switched back to normal table, but still no refresh.
Updatedata is called by button click event on the panel
final Table table = new Table();
final IndexedContainer ic=new IndexedContainer();
public createTable(){
table.setImmediate(true);
table.setEnabled(true);
ic.addContainerProperty("Name", String.class, null);
ic.addContainerProperty("Edit", Button.class, null);
ic.addContainerProperty("Delete", Button.class, null);
table.setContainerDataSource(ic);
}
public void addItems(Table table) {
for (String s : createdNames) {
ic.addItem(s);
ic.getItem(s).getItemProperty("Name").setValue(s);
ic.getItem(s).getItemProperty("Edit").setValue("Edit");
ic.getItem(s).getItemProperty("Delete").setValue("Delete");
}
}
public void updateData() {
IndexedContainer c=(IndexedContainer) table.getContainerDataSource();
c.removeAllItems();
c.addItem("myname");
c.getContainerProperty("myname", "Name").setValue("Mr.X");
table.setContainerDataSource(c);
table.refreshRowCache();
table.requestRepaint();
System.out.println("see the output but no update on table");
}
Edit: turned out problem is not about this code, but this class was instantiated 2 times, so I had different instances; the one i am updating and the one I see.