@@ -0,0 +1,2176 @@
+package com.vaadin.tests.components.table;%0D%0A%0D%0Aimport java.io.Serializable;%0D%0A%0D%0Aimport com.vaadin.data.Property;%0D%0Aimport com.vaadin.data.Property.ValueChangeEvent;%0D%0Aimport com.vaadin.data.util.BeanItemContainer;%0D%0Aimport com.vaadin.tests.components.TestBase;%0D%0Aimport com.vaadin.ui.Label;%0D%0Aimport com.vaadin.ui.Table;%0D%0A%0D%0Apublic class TableSorting extends TestBase %7B%0D%0A%0D%0A    @Override%0D%0A    public void setup() %7B%0D%0A        final Label showID = new Label(%22%22);%0D%0A        final Table testTable = new Table();%0D%0A%0D%0A        BeanItemContainer%3CTestItem%3E cont = new BeanItemContainer%3CTestItem%3E(%0D%0A                TestItem.class);%0D%0A%0D%0A        for (int i = 0; i %3C 20; i++) %7B%0D%0A            TestItem ti = new TestItem();%0D%0A            ti.setTestName(%22Name_%22 + i);%0D%0A            cont.addBean(ti);%0D%0A        %7D%0D%0A        testTable.setContainerDataSource(cont);%0D%0A        testTable.setImmediate(true);%0D%0A        testTable.setSelectable(true);%0D%0A        testTable.setMultiSelect(false);%0D%0A        testTable.setVisibleColumns(new Object%5B%5D %7B %22testName%22 %7D);%0D%0A%0D%0A        // Handle selection change.%0D%0A        testTable.addListener(new Property.ValueChangeListener() %7B%0D%0A            public void valueChange(ValueChangeEvent event) %7B%0D%0A                System.out.println(%22ValueChanged: %22%0D%0A                        + testTable.getValue().toString());%0D%0A                showID.setCaption(%22ID: %22 + testTable.getValue().toString());%0D%0A            %7D%0D%0A        %7D);%0D%0A        addComponent(testTable);%0D%0A        addComponent(showID);%0D%0A    %7D%0D%0A%0D%0A    public class TestItem implements Serializable %7B%0D%0A        private static final long serialVersionUID = -745849615488792221L;%0D%0A        private String testName;%0D%0A%0D%0A        public String getTestName() %7B%0D%0A            return testName;%0D%0A        %7D%0D%0A%0D%0A        public void setTestName(String testName) %7B%0D%0A            this.testName = testName;%0D%0A        %7D%0D%0A    %7D%0D%0A%0D%0A    @Override%0D%0A    protected String getDescription() %7B%0D%0A        return %22Click the header to sort the table, then click on %5C%22Name_10%5C%22. This should show ID: com.vaadin.tests.components.table.TableSorting$TestItem@%3Chex id%3E below the table%22;%0D%0A    %7D%0D%0A%0D%0A    @Override%0D%0A    protected Integer getTicketNumber() %7B%0D%0A        return 4537;%0D%0A    %7D%0D%0A%7D

Test case for #4537 - Table component: ValueChangeListener does not react after sorting a column