diff options
author | Leif Åstrand <leif@vaadin.com> | 2011-12-09 13:38:41 +0000 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2011-12-09 13:38:41 +0000 |
commit | d4b3dcfd0fc12b8069c61ef725b30ee54a79348a (patch) | |
tree | 1983311d10e03cd301e5996110d6beefb071b995 | |
parent | 54aac82d4e87af786a4b8d29a83291ab350f1643 (diff) | |
download | vaadin-framework-d4b3dcfd0fc12b8069c61ef725b30ee54a79348a.tar.gz vaadin-framework-d4b3dcfd0fc12b8069c61ef725b30ee54a79348a.zip |
#8089 Don't fire TextChangeEvent inside TextChangeEvent
svn changeset:22361/svn branch:6.7
-rw-r--r-- | src/com/vaadin/ui/AbstractTextField.java | 16 |
1 files 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); } |