Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Table: ValueChangeListener does not react after sort
Hi,
I have serious trouble with the component Table and ValueChangeListener which does not react after sorting a table column. As far as I see these problems only occur in 6.3.
Example Projekt:
public class VaadinsorttableApplication extends Application {
@Override
public void init() {
Window mainWindow = new Window("Vaadinsorttable Application");
final Label showID = new Label("");
final Table testTable = new Table();
BeanItemContainer<TestItem> cont = new BeanItemContainer<TestItem>(TestItem.class);
for (int i = 0; i < 20; i++) {
TestItem ti = new TestItem();
ti.setTestName("Name_" + i);
cont.addBean(ti);
}
testTable.setContainerDataSource(cont);
testTable.setImmediate(true);
testTable.setSelectable(true);
testTable.setMultiSelect(false);
testTable.setVisibleColumns(new Object[]{"testName"});
// Handle selection change.
testTable.addListener(new Property.ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
System.out.println("ValueChanged: " + testTable.getValue().toString());
showID.setCaption("ID: " + testTable.getValue().toString());
}
});
mainWindow.addComponent(testTable);
mainWindow.addComponent(showID);
setMainWindow(mainWindow);
}
public class TestItem implements Serializable{
private static final long serialVersionUID = -745849615488792221L;
private String testName;
public String getTestName() {
return testName;
}
public void setTestName(String testName) {
this.testName = testName;
}
}
}
When I start the program it displays a small table with 20 records in one column. ValueChangeListener works fine at this moment. After sorting the table by clicking on the columns header this is not the case anymore. For items "Name_10" to "Name_19" the ValueChangeListener simply does not react.
I tested with IE7 and Vaadin 6.2.7 / 6.3: the problem does not occur in 6.2.7
Do you have the same problem? Is it a bug?
(edit: created a ticket: Trac)
Thanks, Thorsten
It is a bug in BeanItemContainer in 6.3.0 and has been fixed. If you test the latest 6.3 nightly version it should work as in 6.2.7.
Hi,
I can confirm that - works fine now!
Thanks, Thorsten