From d4b3dcfd0fc12b8069c61ef725b30ee54a79348a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Leif=20=C3=85strand?= Date: Fri, 9 Dec 2011 13:38:41 +0000 Subject: [PATCH] #8089 Don't fire TextChangeEvent inside TextChangeEvent svn changeset:22361/svn branch:6.7 --- src/com/vaadin/ui/AbstractTextField.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/com/vaadin/ui/AbstractTextField.java b/src/com/vaadin/ui/AbstractTextField.java index 3bfeabd33f..346d370bd5 100644 --- a/src/com/vaadin/ui/AbstractTextField.java +++ b/src/com/vaadin/ui/AbstractTextField.java @@ -70,6 +70,8 @@ public abstract class AbstractTextField extends AbstractField implements */ private boolean textChangeEventPending; + private boolean isFiringTextChangeEvent = false; + private TextChangeEventMode textChangeEventMode = TextChangeEventMode.LAZY; private final int DEFAULT_TEXTCHANGE_TIMEOUT = 400; @@ -449,9 +451,14 @@ public abstract class AbstractTextField extends AbstractField implements /* ** Text Change Events ** */ private void firePendingTextChangeEvent() { - if (textChangeEventPending) { + if (textChangeEventPending && !isFiringTextChangeEvent) { + isFiringTextChangeEvent = true; textChangeEventPending = false; - fireEvent(new TextChangeEventImpl(this)); + try { + fireEvent(new TextChangeEventImpl(this)); + } finally { + isFiringTextChangeEvent = false; + } } } @@ -494,11 +501,6 @@ public abstract class AbstractTextField extends AbstractField implements firePendingTextChangeEvent(); } - /* - * Reset lastKnownTextContent field on value change. We know the value - * now. - */ - lastKnownTextContent = null; super.setInternalValue(newValue); } -- 2.39.5