]> source.dussan.org Git - vaadin-framework.git/commitdiff
Check if attached in Timer instead of canceling timer on component detach. #6507
authorJohn Alhroos <john.ahlroos@itmill.com>
Tue, 8 Mar 2011 13:37:10 +0000 (13:37 +0000)
committerJohn Alhroos <john.ahlroos@itmill.com>
Tue, 8 Mar 2011 13:37:10 +0000 (13:37 +0000)
svn changeset:17673/svn branch:6.5

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

index 39994caf17335fe896bc125b5d1a75443e6634ff..edf4261988e0b352d996326e1301b74952a7f266 100644 (file)
@@ -145,12 +145,14 @@ public class VTextField extends TextBoxBase implements Paintable, Field,
 
         @Override
         public void run() {
-            updateCursorPosition();
-            boolean textChanged = communicateTextValueToServer();
-            if (textChanged) {
-                client.sendPendingVariableChanges();
+            if (isAttached()) {
+                updateCursorPosition();
+                boolean textChanged = communicateTextValueToServer();
+                if (textChanged) {
+                    client.sendPendingVariableChanges();
+                }
+                scheduled = false;
             }
-            scheduled = false;
         }
     };
     private boolean scheduled = false;
@@ -325,7 +327,6 @@ public class VTextField extends TextBoxBase implements Paintable, Field,
     @Override
     protected void onDetach() {
         super.onDetach();
-        textChangeEventTrigger.cancel();
         detachCutEventListener(getElement());
         if (focusedTextField == this) {
             focusedTextField = null;