aboutsummaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests/components/table/AddNonRenderedRow.java
blob: 741c5f6cecc2e22829788c4dfc22b0afb7872f7c (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
43
44
45
46
47
48
49
package com.vaadin.tests.components.table;

import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.Table;

public class AddNonRenderedRow extends TestBase {
    int index = 0;

    private final Table table = new Table();

    @Override
    public void setup() {

        table.setPageLength(5);
        table.addContainerProperty("rowID", Integer.class, null);
        for (int i = 0; i < 4; i++) {
            addRow();
        }

        Button addrowButton = new Button("Add row");
        addrowButton.addListener(new ClickListener() {
            @Override
            public void buttonClick(ClickEvent pEvent) {
                addRow();
            }
        });

        addComponent(table);
        addComponent(addrowButton);
    }

    private void addRow() {
        table.addItem(new Object[] { Integer.valueOf(++index) }, null);
        // table.refreshRowCache();
    }

    @Override
    protected String getDescription() {
        return "Adding a row to the table should work even when the added rows are not visible.";
    }

    @Override
    protected Integer getTicketNumber() {
        return Integer.valueOf(8077);
    }
}