]> source.dussan.org Git - vaadin-framework.git/commitdiff
fixes #6866
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Tue, 19 Apr 2011 14:18:11 +0000 (14:18 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Tue, 19 Apr 2011 14:18:11 +0000 (14:18 +0000)
svn changeset:18398/svn branch:6.5

src/com/vaadin/ui/AbstractTextField.java

index c921b946cc068cd4db068531964593a97f1a4b73..693106b686be529ad0fe33f8fb14a71d5ba9d675 100644 (file)
@@ -446,10 +446,16 @@ public abstract class AbstractTextField extends AbstractField implements
 
     @Override
     protected void setInternalValue(Object newValue) {
-        if (changingVariables) {
+        if (changingVariables && !textChangeEventPending) {
             /*
-             * Fire text change event before value change event if change is
-             * coming from the client side.
+             * Fire a "simulated" text change event before value change event if
+             * change is coming from the client side.
+             * 
+             * Iff there is both value change and textChangeEvent in same
+             * variable burst, it is a text field in non immediate mode and the
+             * text change event "flushed" queued value change event. In this
+             * case textChangeEventPending flag is already on and text change
+             * event will be fired after the value change event.
              */
             if (newValue == null && lastKnownTextContent != null
                     && !lastKnownTextContent.equals(getNullRepresentation())) {
@@ -463,9 +469,7 @@ public abstract class AbstractTextField extends AbstractField implements
                 textChangeEventPending = true;
             }
 
-            if (textChangeEventPending) {
-                firePendingTextChangeEvent();
-            }
+            firePendingTextChangeEvent();
         }
         super.setInternalValue(newValue);
     }