From 608bac4d2d3f8ddf7e72fe01de3a76070015fab3 Mon Sep 17 00:00:00 2001 From: Automerge Date: Wed, 14 Mar 2012 14:07:45 +0000 Subject: [merge from 6.7] #7607 Make Table scroll to the very bottom when needed svn changeset:23242/svn branch:6.8 --- src/com/vaadin/ui/Table.java | 10 +++++++--- 1 file 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 -- cgit v1.2.3