]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fixed row focus not removed when selecting rows in Table #10036 43/243/1
authorJohn Ahlroos <john@vaadin.com>
Mon, 12 Nov 2012 12:38:08 +0000 (14:38 +0200)
committerJohn Ahlroos <john@vaadin.com>
Mon, 12 Nov 2012 12:38:08 +0000 (14:38 +0200)
Change-Id: Ie9089d7d35e8c3d27f93938141c0378816e4f48e

client/src/com/vaadin/client/ui/table/VScrollTable.java
uitest/src/com/vaadin/tests/components/table/RowFocusAppliedAndRemovedOnSelection.html [new file with mode: 0644]

index df44f58740b7ddec6eb23a21c93b51340661d7ba..066c60a2cee6b3055a5a3daeeb8a1efc2773cdaa 100644 (file)
@@ -6503,7 +6503,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
 
         // Remove previous selection
         if (focusedRow != null && focusedRow != row) {
-            focusedRow.removeStyleName(getStylePrimaryName());
+            focusedRow.removeStyleName(getStylePrimaryName() + "-focus");
         }
 
         if (row != null) {
diff --git a/uitest/src/com/vaadin/tests/components/table/RowFocusAppliedAndRemovedOnSelection.html b/uitest/src/com/vaadin/tests/components/table/RowFocusAppliedAndRemovedOnSelection.html
new file mode 100644 (file)
index 0000000..a2f57aa
--- /dev/null
@@ -0,0 +1,52 @@
+<?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: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.WideSelectableTable</td>
+    <td></td>
+</tr>
+<tr>
+    <td>mouseClick</td>
+    <td>vaadin=runcomvaadintestscomponentstableWideSelectableTable::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[6]/domChild[0]</td>
+    <td>13,15</td>
+</tr>
+<tr>
+    <td>mouseClick</td>
+    <td>vaadin=runcomvaadintestscomponentstableWideSelectableTable::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[6]/domChild[0]</td>
+    <td>15,14</td>
+</tr>
+<tr>
+    <td>mouseClick</td>
+    <td>vaadin=runcomvaadintestscomponentstableWideSelectableTable::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[3]/domChild[6]/domChild[0]</td>
+    <td>15,12</td>
+</tr>
+<tr>
+    <td>assertNotCSSClass</td>
+    <td>vaadin=runcomvaadintestscomponentstableWideSelectableTable::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]</td>
+    <td>v-table-focus</td>
+</tr>
+<tr>
+    <td>assertNotCSSClass</td>
+    <td>vaadin=runcomvaadintestscomponentstableWideSelectableTable::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]</td>
+    <td>v-table-focus</td>
+</tr>
+<tr>
+    <td>assertCSSClass</td>
+    <td>vaadin=runcomvaadintestscomponentstableWideSelectableTable::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[3]</td>
+    <td>v-table-focus</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>