--- /dev/null
+<?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://arturwin.office.itmill.com:8888/" />
+<title>New Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">New Test</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.table.TableScrollOnFocus?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>scroll</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableScrollOnFocus::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VScrollTable[0]/domChild[1]</td>
+ <td>3864</td>
+</tr>
+<tr>
+ <td>pause</td>
+ <td>300</td>
+ <td></td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableScrollOnFocus::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[1]</td>
+ <td>391,141</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableScrollOnFocus::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VScrollTable[0]/domChild[1]</td>
+ <td>3234</td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>visible-185-199</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
--- /dev/null
+package com.vaadin.tests.components.table;\r
+\r
+import com.vaadin.data.Property.ValueChangeEvent;\r
+import com.vaadin.data.Property.ValueChangeListener;\r
+import com.vaadin.tests.components.TestBase;\r
+import com.vaadin.ui.CheckBox;\r
+import com.vaadin.ui.Table;\r
+\r
+public class TableScrollOnFocus extends TestBase {\r
+ @Override\r
+ protected void setup() {\r
+ final Table table = new Table();\r
+ final CheckBox chkSelectable = new CheckBox("selectable");\r
+\r
+ chkSelectable.setImmediate(true);\r
+ chkSelectable.addListener(new ValueChangeListener() {\r
+ public void valueChange(ValueChangeEvent event) {\r
+ table.setSelectable(chkSelectable.booleanValue());\r
+ }\r
+ });\r
+\r
+ table.addContainerProperty("row #", String.class, "-");\r
+ table.setColumnWidth("row #", 150);\r
+ for (int i = 1; i < 200; i++) {\r
+ table.addItem(new String[] { "" + i }, null);\r
+ }\r
+ table.setSortDisabled(true);\r
+\r
+ chkSelectable.setValue(true);\r
+\r
+ addComponent(chkSelectable);\r
+ addComponent(table);\r
+ }\r
+\r
+ @Override\r
+ protected String getDescription() {\r
+ return "The table scrolls up 2 pages after loosing and regaining the focus!</b><p>"\r
+ + "Drag scrollbar to top then to the bottom of the table.<br>"\r
+ + "Click somewhere beside the table to take away the focus,<br>"\r
+ + "then click back on the table (header or scrollbar) to give back the focus<br>"\r
+ + "(Pressing Tab and Shift-Tab does the same job).<p>"\r
+ + "If the table is set to non-selectable-mode, no self-scrolling occurs.";\r
+ }\r
+\r
+ @Override\r
+ protected Integer getTicketNumber() {\r
+ return 6774;\r
+ }\r
+}
\ No newline at end of file
</tr>
<!--Select the last item (79)-->
<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableScrollsOnSelection::/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[79]/domChild[0]/domChild[0]</td>
- <td>38,-892</td>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableScrollsOnSelection::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[79]/domChild[0]/domChild[0]</td>
+ <td>38,-892</td>
</tr>
<!--Ensure the page is not scrolled to the beginning-->
<tr>
--- /dev/null
+package com.vaadin.tests.components.table;
+
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.VerticalLayout;
+
+public class WideSelectableTable extends TestBase {
+
+ @Override
+ protected void setup() {
+ final int NUMBER_OF_COLS = 50;
+
+ // mainWindow.setSizeFull();
+ // setMainWindow(mainWindow);
+
+ Table ptable = new Table();
+ for (int colcount = 0; colcount < NUMBER_OF_COLS; colcount++) {
+ String col = "COL_" + colcount + "";
+ ptable.addContainerProperty(col, String.class, "--");
+ ptable.addItem(colcount + "-").getItemProperty(col)
+ .setValue("--" + colcount + "");
+ }
+ ptable.setSelectable(true);
+ ptable.setMultiSelect(true);
+ ptable.setColumnReorderingAllowed(false);
+ ptable.setImmediate(true);
+
+ ptable.setWidth("100%");
+ ptable.setPageLength(5);
+
+ VerticalLayout vl = new VerticalLayout();
+ vl.addComponent(ptable);
+ addComponent(vl);
+ }
+
+ @Override
+ protected String getDescription() {
+ return "A wide table scrolls to the beginning when sorting a column at the beginning when sorting a column at the end";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 6788;
+ }
+}
\ No newline at end of file