]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fix broken error tooltips in FormLayout (#8794)
authorLeif Åstrand <leif@vaadin.com>
Fri, 8 Jun 2012 10:58:07 +0000 (13:58 +0300)
committerLeif Åstrand <leif@vaadin.com>
Fri, 8 Jun 2012 10:58:07 +0000 (13:58 +0300)
src/com/vaadin/terminal/gwt/client/ui/formlayout/VFormLayout.java
tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutErrorHover.html [new file with mode: 0644]
tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutErrorHover.java [new file with mode: 0644]

index 85584755a618a372ff6a9934bff021e0298803db..8a859c409c40405d7b1dcdea6b8d55e1b69c1368 100644 (file)
@@ -35,7 +35,6 @@ public class VFormLayout extends SimplePanel {
 
     private final static String CLASSNAME = "v-formlayout";
 
-    ApplicationConnection client;
     VFormLayoutTable table;
 
     public VFormLayout() {
@@ -371,7 +370,7 @@ public class VFormLayout extends SimplePanel {
         public void onBrowserEvent(Event event) {
             super.onBrowserEvent(event);
             if (owner != null) {
-                client.handleTooltipEvent(event, owner);
+                owner.getConnection().handleTooltipEvent(event, owner);
             }
         }
 
diff --git a/tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutErrorHover.html b/tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutErrorHover.html
new file mode 100644 (file)
index 0000000..f6fc12a
--- /dev/null
@@ -0,0 +1,47 @@
+<?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="" />
+<title>PropertyValueChange</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">PropertyValueChange</td></tr>
+</thead><tbody>
+<tr>
+       <td>open</td>
+       <td>/run/com.vaadin.tests.components.formlayout.FormLayoutErrorHover?restartApplication&amp;debug</td>
+       <td></td>
+</tr>
+<tr>
+       <td>enterCharacter</td>
+       <td>vaadin=runcomvaadintestscomponentsformlayoutFormLayoutErrorHover::/VVerticalLayout[0]/VVerticalLayout[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VPopupCalendar[0]#field</td>
+       <td>asdf</td>
+</tr>
+<tr>
+       <td>pressSpecialKey</td>
+       <td>vaadin=runcomvaadintestscomponentsformlayoutFormLayoutErrorHover::/VVerticalLayout[0]/VVerticalLayout[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VPopupCalendar[0]#field</td>
+       <td>enter</td>
+</tr>
+<!--Hover error indicator-->
+<tr>
+       <td>mouseOver</td>
+       <td>vaadin=runcomvaadintestscomponentsformlayoutFormLayoutErrorHover::/VVerticalLayout[0]/VVerticalLayout[0]/VFormLayout[0]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+       <td></td>
+</tr>
+<tr>
+       <td>pause</td>
+       <td></td>
+       <td>2000</td>
+</tr>
+<tr>
+       <td>assertText</td>
+       <td>vaadin=runcomvaadintestscomponentsformlayoutFormLayoutErrorHover::Root/VTooltip[0]/FlowPanel[0]/VErrorMessage[0]/HTML[0]/domChild[0]</td>
+       <td>Date format not recognized</td>
+</tr>
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutErrorHover.java b/tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutErrorHover.java
new file mode 100644 (file)
index 0000000..b65a448
--- /dev/null
@@ -0,0 +1,33 @@
+/* 
+@VaadinApache2LicenseForJavaFiles@
+ */
+package com.vaadin.tests.components.formlayout;
+
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestRoot;
+import com.vaadin.ui.FormLayout;
+import com.vaadin.ui.PopupDateField;
+
+public class FormLayoutErrorHover extends AbstractTestRoot {
+
+    @Override
+    protected void setup(WrappedRequest request) {
+        FormLayout formLayout = new FormLayout();
+        PopupDateField fromDate = new PopupDateField("Date");
+        fromDate.setImmediate(true);
+        formLayout.addComponent(fromDate);
+
+        addComponent(formLayout);
+    }
+
+    @Override
+    protected String getTestDescription() {
+        return "Enter some random text to the date field and press enter. Then hover the error indicator. This should show a message about the error.";
+    }
+
+    @Override
+    protected Integer getTicketNumber() {
+        return Integer.valueOf(8794);
+    }
+
+}