]> source.dussan.org Git - vaadin-framework.git/commitdiff
fixes #6316, reviewed by artur
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Tue, 25 Jan 2011 09:58:24 +0000 (09:58 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Tue, 25 Jan 2011 09:58:24 +0000 (09:58 +0000)
svn changeset:17008/svn branch:6.5

src/com/vaadin/terminal/gwt/client/ui/VTextField.java
src/com/vaadin/terminal/gwt/client/ui/VView.java

index 334f2617a5f56ec7c58150eab13b39b9681ee5b9..49d18f0867a628eba527eadf5685ab77abf3eaac 100644 (file)
@@ -326,6 +326,9 @@ public class VTextField extends TextBoxBase implements Paintable, Field,
     protected void onDetach() {
         super.onDetach();
         detachCutEventListener(getElement());
+        if (focusedTextField == this) {
+            focusedTextField = null;
+        }
     }
 
     @Override
index 2d47790dab348227f54627a2571c4d8ab94582fe..ea43deba9d3cf6bb44287edc1d2048ccb4c69d72 100644 (file)
@@ -505,6 +505,10 @@ public class VView extends SimplePanel implements Container, ResizeHandler,
     public void onWindowClosing(Window.ClosingEvent event) {
         // Change focus on this window in order to ensure that all state is
         // collected from textfields
+        // TODO this is a naive hack, that only works with text fields and may
+        // cause some odd issues. Should be replaced with a decent solution, see
+        // also related BeforeShortcutActionListener interface. Same interface
+        // might be usable here.
         VTextField.flushChangesFromFocusedTextField();
 
         // Send the closing state to server