diff options
author | John Ahlroos <john@vaadin.com> | 2013-02-28 09:31:32 +0200 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2013-03-04 13:30:08 +0000 |
commit | 718b7dea773fddc47a316d82989e0759af6df67b (patch) | |
tree | 50dd5a04e5e02f63da72620633830d4a6724922e /uitest/src/com/vaadin/tests/components/table/TableRowScrolledBottom.java | |
parent | da5a55ccdf3c5a1732ae246c43370051633c9265 (diff) | |
download | vaadin-framework-718b7dea773fddc47a316d82989e0759af6df67b.tar.gz vaadin-framework-718b7dea773fddc47a316d82989e0759af6df67b.zip |
Fixed scrolling jumping up to first row when adding rows and adjusting the currentPageFirstItem in the same UIDL request #10970
Change-Id: I54562e7e0c5429f3493892cf3a14380b0d15bbfd
Diffstat (limited to 'uitest/src/com/vaadin/tests/components/table/TableRowScrolledBottom.java')
-rw-r--r-- | uitest/src/com/vaadin/tests/components/table/TableRowScrolledBottom.java | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/table/TableRowScrolledBottom.java b/uitest/src/com/vaadin/tests/components/table/TableRowScrolledBottom.java new file mode 100644 index 0000000000..9823fc1859 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/TableRowScrolledBottom.java @@ -0,0 +1,55 @@ +package com.vaadin.tests.components.table; + +import com.vaadin.shared.ui.label.ContentMode; +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Button; +import com.vaadin.ui.Label; +import com.vaadin.ui.Table; +import com.vaadin.ui.VerticalLayout; + +public class TableRowScrolledBottom extends TestBase { + + @Override + protected void setup() { + + final Table table = new Table(); + table.setSizeFull(); + table.addContainerProperty("Test", Label.class, null); + table.setHeight("100%"); + + Button button = new Button("Add 100 items"); + button.addClickListener(new Button.ClickListener() { + int i = 0; + + @Override + public void buttonClick(Button.ClickEvent event) { + for (int j = 0; j < 100; j++) { + ++i; + table.addItem( + new Object[] { new Label( + "This is a test item with long text so that there is something to see Nr. <b>" + + i + + "</b>. This text must be long otherwise the timing issue on Firefox does not occur. This works fine in IE", + ContentMode.HTML) }, i); + table.setCurrentPageFirstItemIndex(table + .getContainerDataSource().size() - 1); + } + } + }); + + addComponent(table); + addComponent(button); + getLayout().setExpandRatio(table, 1f); + } + + @Override + protected String getDescription() { + return "Table should be scrolled to bottom when adding rows and updating currentPageFirstItemIndex to last item"; + } + + @Override + protected Integer getTicketNumber() { + return 10970; + } + +} |