diff options
author | Automerge <automerge@vaadin.com> | 2012-03-14 14:07:45 +0000 |
---|---|---|
committer | Automerge <automerge@vaadin.com> | 2012-03-14 14:07:45 +0000 |
commit | 608bac4d2d3f8ddf7e72fe01de3a76070015fab3 (patch) | |
tree | 2134b4fd331044721bc900ee466151f1050e1c0b | |
parent | 9b839ca728bca6dd27ba418875007435fe76f2a6 (diff) | |
download | vaadin-framework-608bac4d2d3f8ddf7e72fe01de3a76070015fab3.tar.gz vaadin-framework-608bac4d2d3f8ddf7e72fe01de3a76070015fab3.zip |
[merge from 6.7] #7607 Make Table scroll to the very bottom when needed
svn changeset:23242/svn branch:6.8
-rw-r--r-- | src/com/vaadin/ui/Table.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/com/vaadin/ui/Table.java b/src/com/vaadin/ui/Table.java index 79adc2c38f..88961e610a 100644 --- a/src/com/vaadin/ui/Table.java +++ b/src/com/vaadin/ui/Table.java @@ -971,7 +971,9 @@ public class Table extends AbstractSelect implements Action.Container, } if (index > maxIndex) { - setCurrentPageFirstItemIndex(maxIndex); + // Note that we pass index, not maxIndex, letting + // setCurrentPageFirstItemIndex handle the situation. + setCurrentPageFirstItemIndex(index); return; } @@ -1259,9 +1261,11 @@ public class Table extends AbstractSelect implements Action.Container, maxIndex = 0; } - // Ensures that the new value is valid + // Assume that we want to scroll to the very bottom (so that the bottom + // row is completely visible even if (table height) / (row height) is + // not an integer.) if (newIndex > maxIndex) { - newIndex = maxIndex; + newIndex = maxIndex + 1; } // Refresh first item id |