Browse Source

[merge from 6.7] #7607 Make Table scroll to the very bottom when needed

svn changeset:23242/svn branch:6.8
tags/7.0.0.alpha2
Automerge 12 years ago
parent
commit
608bac4d2d
1 changed files with 7 additions and 3 deletions
  1. 7
    3
      src/com/vaadin/ui/Table.java

+ 7
- 3
src/com/vaadin/ui/Table.java View 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

Loading…
Cancel
Save