aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/main/java/com/vaadin/tests/components/table/DisabledTableShouldNotSendPageLengthUpdates.java
blob: 77599c6005ca3766516425d172baedfb011cfec5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package com.vaadin.tests.components.table;

import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.HorizontalSplitPanel;
import com.vaadin.v7.ui.Table;

@SuppressWarnings("serial")
public class DisabledTableShouldNotSendPageLengthUpdates extends TestBase {

    final Table table = new Table();

    @Override
    protected void setup() {
        HorizontalSplitPanel split = new HorizontalSplitPanel();
        table.addContainerProperty("name", Integer.class, 0);
        Button button = new Button("Add items", event -> {
            for (int i = 0; i < 5; i++) {
                Object id = table.addItem();
                table.getItem(id).getItemProperty("name").setValue(i);
            }
        });
        table.setEnabled(false);
        table.setSizeFull();
        split.setFirstComponent(table);
        split.setSecondComponent(button);
        getLayout().setSizeFull();
        split.setSizeFull();
        addComponent(split);
    }

    @Override
    protected String getDescription() {
        return "A disabled table should not send pageLength updates causing 'Warning: Ignoring variable change for disabled component class com.vaadin.ui.Table' warnings in the server logs";
    }

    @Override
    protected Integer getTicketNumber() {
        return 4317;
    }

}