From: John Alhroos Date: Tue, 8 Mar 2011 13:37:10 +0000 (+0000) Subject: Check if attached in Timer instead of canceling timer on component detach. #6507 X-Git-Tag: 6.7.0.beta1~380^2~13 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a600af6389ebb12a86ebe75cef67c9223032b6bf;p=vaadin-framework.git Check if attached in Timer instead of canceling timer on component detach. #6507 svn changeset:17673/svn branch:6.5 --- 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;