]> source.dussan.org Git - vaadin-framework.git/commitdiff
[merge from 6.7] #7607 Make Table scroll to the very bottom when needed
authorAutomerge <automerge@vaadin.com>
Wed, 14 Mar 2012 14:07:45 +0000 (14:07 +0000)
committerAutomerge <automerge@vaadin.com>
Wed, 14 Mar 2012 14:07:45 +0000 (14:07 +0000)
svn changeset:23242/svn branch:6.8

src/com/vaadin/ui/Table.java

index 79adc2c38fcc298e6ac0d67a74bf6f5ca927504b..88961e610aaaa3d2e58404864a9ee93a5462349b 100644 (file)
@@ -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