]> source.dussan.org Git - vaadin-framework.git/commitdiff
[merge from 6.7] Reverted #7607 fixes and removed the test for now because they cause...
authorAutomerge <automerge@vaadin.com>
Tue, 17 Apr 2012 17:06:08 +0000 (17:06 +0000)
committerAutomerge <automerge@vaadin.com>
Tue, 17 Apr 2012 17:06:08 +0000 (17:06 +0000)
svn changeset:23566/svn branch:6.8

src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java
src/com/vaadin/ui/Table.java
tests/testbench/com/vaadin/tests/components/table/SetCurrentPageFirstItemId.html [deleted file]

index ee33f3375844003094e2305761ee71e53474b7f7..6bbc2a6ceb297006236a2f5842dfb20aff2ebc42 100644 (file)
@@ -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) {
index 88961e610aaaa3d2e58404864a9ee93a5462349b..e605ec4f6b69002fb01fe12d9f9e22ab8d1956ef 100644 (file)
@@ -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 (file)
index 8881c0d..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head profile="http://selenium-ide.openqa.org/profiles/test-case">
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-<link rel="selenium.base" href="http://localhost:8067/" />
-<title>SetCurrentPageFirstItemId</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-<thead>
-<tr><td rowspan="1" colspan="3">SetCurrentPageFirstItemId</td></tr>
-</thead><tbody>
-<tr>
-       <td>open</td>
-       <td>/run/SetCurrentPageFirstItemId?restartApplication</td>
-       <td></td>
-</tr>
-<tr>
-       <td>click</td>
-       <td>vaadin=runSetCurrentPageFirstItemId::/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
-       <td></td>
-</tr>
-<tr>
-       <td>click</td>
-       <td>vaadin=runSetCurrentPageFirstItemId::/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
-       <td></td>
-</tr>
-<tr>
-       <td>click</td>
-       <td>vaadin=runSetCurrentPageFirstItemId::/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
-       <td></td>
-</tr>
-<tr>
-       <td>click</td>
-       <td>vaadin=runSetCurrentPageFirstItemId::/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
-       <td></td>
-</tr>
-<tr>
-       <td>click</td>
-       <td>vaadin=runSetCurrentPageFirstItemId::/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
-       <td></td>
-</tr>
-<tr>
-       <td>pause</td>
-       <td>300</td>
-       <td></td>
-</tr>
-<tr>
-       <td>assertText</td>
-       <td>vaadin=runSetCurrentPageFirstItemId::/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[24]/domChild[0]/domChild[0]</td>
-       <td>24</td>
-</tr>
-<tr>
-       <td>screenCapture</td>
-       <td></td>
-       <td>scrolled-to-bottom</td>
-</tr>
-
-</tbody></table>
-</body>
-</html>