blob: aebb4942474b303857b36bf0b6b4273ecf5db67b (
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
50
51
52
53
54
55
56
|
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;
import com.vaadin.ui.VerticalLayout;
public class SetCurrentPageFirstItemId extends TestBase {
int index = 0;
private final Table table = new Table();
@Override
public void setup() {
VerticalLayout mainLayout = new VerticalLayout();
mainLayout.setHeight("100%");
mainLayout.setMargin(true);
getMainWindow().setContent(mainLayout);
mainLayout.addComponent(table);
table.setSizeFull();
table.addContainerProperty("rowID", Integer.class, null);
for (int i = 0; i < 20; i++) {
addRow();
}
Button addrowButton = new Button("Add row");
addrowButton.addListener(new ClickListener() {
@Override
public void buttonClick(ClickEvent pEvent) {
Object id = addRow();
table.setCurrentPageFirstItemId(id);
}
});
mainLayout.addComponent(addrowButton);
}
private Object addRow() {
return table.addItem(new Object[] { index++ }, null);
}
@Override
protected String getDescription() {
return "Table.setCurrentPageFirstItemId doesn't always work with full sized Table";
}
@Override
protected Integer getTicketNumber() {
return 7607;
}
}
|