From c3e10ebbbc48d124a88d6e92e16faccdebe43223 Mon Sep 17 00:00:00 2001 From: Automerge Date: Tue, 17 Apr 2012 17:06:08 +0000 Subject: [PATCH] [merge from 6.7] Reverted #7607 fixes and removed the test for now because they cause the #8662 regression. svn changeset:23566/svn branch:6.8 --- .../terminal/gwt/client/ui/VScrollTable.java | 15 ++++- src/com/vaadin/ui/Table.java | 11 ++-- .../table/SetCurrentPageFirstItemId.html | 62 ------------------- 3 files changed, 19 insertions(+), 69 deletions(-) delete mode 100644 tests/testbench/com/vaadin/tests/components/table/SetCurrentPageFirstItemId.html diff --git a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java index ee33f33758..6bbc2a6ceb 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java @@ -2065,9 +2065,18 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler, isNewBody = false; if (firstvisible > 0) { - scrollBodyPanel - .setScrollPosition(measureRowHeightOffset(firstvisible)); - firstRowInViewPort = firstvisible; + // FIXME #7607 + // Originally deferred due to Firefox oddities which should not + // occur any more. Currently deferring breaks Webkit scrolling with + // relative-height tables, but not deferring instead breaks tables + // with explicit page length. + Scheduler.get().scheduleDeferred(new Command() { + public void execute() { + scrollBodyPanel + .setScrollPosition(measureRowHeightOffset(firstvisible)); + firstRowInViewPort = firstvisible; + } + }); } if (enabled) { diff --git a/src/com/vaadin/ui/Table.java b/src/com/vaadin/ui/Table.java index 88961e610a..e605ec4f6b 100644 --- a/src/com/vaadin/ui/Table.java +++ b/src/com/vaadin/ui/Table.java @@ -1261,11 +1261,14 @@ public class Table extends AbstractSelect implements Action.Container, maxIndex = 0; } - // 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.) + /* + * 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 (newIndex > maxIndex) { - newIndex = maxIndex + 1; + newIndex = maxIndex; } // Refresh first item id diff --git a/tests/testbench/com/vaadin/tests/components/table/SetCurrentPageFirstItemId.html b/tests/testbench/com/vaadin/tests/components/table/SetCurrentPageFirstItemId.html deleted file mode 100644 index 8881c0d2f5..0000000000 --- a/tests/testbench/com/vaadin/tests/components/table/SetCurrentPageFirstItemId.html +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - -SetCurrentPageFirstItemId - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SetCurrentPageFirstItemId
open/run/SetCurrentPageFirstItemId?restartApplication
clickvaadin=runSetCurrentPageFirstItemId::/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]
clickvaadin=runSetCurrentPageFirstItemId::/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]
clickvaadin=runSetCurrentPageFirstItemId::/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]
clickvaadin=runSetCurrentPageFirstItemId::/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]
clickvaadin=runSetCurrentPageFirstItemId::/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]
pause300
assertTextvaadin=runSetCurrentPageFirstItemId::/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[24]/domChild[0]/domChild[0]24
screenCapturescrolled-to-bottom
- - -- 2.39.5