summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2013-09-26 09:28:50 +0300
committerArtur Signell <artur@vaadin.com>2013-09-26 09:28:50 +0300
commitc18b20050d6b04a2c69b3fdfc75ca901b78edc0a (patch)
tree1d91200782aa20a4fcf331bb0f773070c7cd080a /server
parent7c5bdce3b4c76e7f19bc46bcaed135d67a94f06a (diff)
parentbd0ae0581f265be57374b236cfe1b71043ab69aa (diff)
downloadvaadin-framework-c18b20050d6b04a2c69b3fdfc75ca901b78edc0a.tar.gz
vaadin-framework-c18b20050d6b04a2c69b3fdfc75ca901b78edc0a.zip
Merge changes from origin/7.1
7f7dc31 Base files for TB3 tests (#12572) 6b17abe Make it possible to override web driver in tests (#12572) a682e3b Refactored build scripts to support TB2, TB3 + integration tests (#12572) e556642 Converted servlet integration tests to TB3 (#12573) 21af0c3 Updated TB3 tests to use Firefox 24 (#12604) a7583c6 TB3 test for browsers (#12572) 37b8543 Do not add empty package javadoc for new classes 0248b8f Fixes browser detection for IE11 (#12638) 1df28c3 Run TB3 tests also on IE11 (#12631) a2daf65 Converted TB2 push tests to TB3 (#12580) d3261d7 Fixes issue with Table not scrolling completely to the end #12651 bd0ae05 Limit the number of tests run concurrently (#12572) Change-Id: Idb4389aac388b728490a4ffd57d30aee20ea9fe8
Diffstat (limited to 'server')
-rw-r--r--server/src/com/vaadin/ui/Table.java32
1 files changed, 28 insertions, 4 deletions
diff --git a/server/src/com/vaadin/ui/Table.java b/server/src/com/vaadin/ui/Table.java
index bd2b7828de..32ed738697 100644
--- a/server/src/com/vaadin/ui/Table.java
+++ b/server/src/com/vaadin/ui/Table.java
@@ -427,6 +427,12 @@ public class Table extends AbstractSelect implements Action.Container,
private int currentPageFirstItemIndex = 0;
/**
+ * Index of the "first" item on the last page if a user has used
+ * setCurrentPageFirstItemIndex to scroll down. -1 if not set.
+ */
+ private int currentPageFirstItemIndexOnLastPage = -1;
+
+ /**
* Holds value of property selectable.
*/
private boolean selectable = false;
@@ -1477,12 +1483,14 @@ public class Table extends AbstractSelect implements Action.Container,
}
/*
- * FIXME #7607 Take somehow into account the case where we want to
- * scroll to the bottom so that the last row is completely visible even
- * if (table height) / (row height) is not an integer. Reverted the
- * original fix because of #8662 regression.
+ * If the new index is on the last page we set the index to be the first
+ * item on that last page and make a note of the real index for the
+ * client side to be able to move the scroll position to the correct
+ * position.
*/
+ int indexOnLastPage = -1;
if (newIndex > maxIndex) {
+ indexOnLastPage = newIndex;
newIndex = maxIndex;
}
@@ -1494,6 +1502,20 @@ public class Table extends AbstractSelect implements Action.Container,
currentPageFirstItemId = null;
}
currentPageFirstItemIndex = newIndex;
+
+ if (needsPageBufferReset) {
+ /*
+ * The flag currentPageFirstItemIndexOnLastPage denotes a user
+ * set scrolling position on the last page via
+ * setCurrentPageFirstItemIndex() and shouldn't be changed by
+ * the table component internally changing the firstvisible item
+ * on lazy row fetching. Doing so would make the scrolling
+ * position not be updated correctly when the lazy rows are
+ * finally rendered.
+ */
+ currentPageFirstItemIndexOnLastPage = indexOnLastPage;
+ }
+
} else {
// For containers not supporting indexes, we must iterate the
@@ -3447,6 +3469,8 @@ public class Table extends AbstractSelect implements Action.Container,
if (getCurrentPageFirstItemIndex() != 0 || getPageLength() > 0) {
target.addVariable(this, "firstvisible",
getCurrentPageFirstItemIndex());
+ target.addVariable(this, "firstvisibleonlastpage",
+ currentPageFirstItemIndexOnLastPage);
}
}