From a600af6389ebb12a86ebe75cef67c9223032b6bf Mon Sep 17 00:00:00 2001 From: John Alhroos Date: Tue, 8 Mar 2011 13:37:10 +0000 Subject: [PATCH] Check if attached in Timer instead of canceling timer on component detach. #6507 svn changeset:17673/svn branch:6.5 --- .../vaadin/terminal/gwt/client/ui/VTextField.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTextField.java b/src/com/vaadin/terminal/gwt/client/ui/VTextField.java index 39994caf17..edf4261988 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VTextField.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VTextField.java @@ -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; -- 2.39.5