From 16aed4b33f58c9b6040bc7f12d02a1cb5d76692a Mon Sep 17 00:00:00 2001 From: Matti Tahvonen Date: Tue, 19 Apr 2011 14:18:11 +0000 Subject: [PATCH] fixes #6866 svn changeset:18398/svn branch:6.5 --- src/com/vaadin/ui/AbstractTextField.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/com/vaadin/ui/AbstractTextField.java b/src/com/vaadin/ui/AbstractTextField.java index c921b946cc..693106b686 100644 --- a/src/com/vaadin/ui/AbstractTextField.java +++ b/src/com/vaadin/ui/AbstractTextField.java @@ -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); } -- 2.39.5