diff options
author | Artur Signell <artur.signell@itmill.com> | 2011-07-12 07:53:00 +0000 |
---|---|---|
committer | Artur Signell <artur.signell@itmill.com> | 2011-07-12 07:53:00 +0000 |
commit | 89bbe3be62cd65f008aaf062247d8b313e415a9e (patch) | |
tree | 6939581770590bfddc738d94586e120e0db0a809 | |
parent | d490d5440d1d13b57e061e9d860d9225d1d5c4ce (diff) | |
download | vaadin-framework-89bbe3be62cd65f008aaf062247d8b313e415a9e.tar.gz vaadin-framework-89bbe3be62cd65f008aaf062247d8b313e415a9e.zip |
#6588 Reverted [19527] as it assumes that the text/value is never changed in a TextChangeListener
svn changeset:19705/svn branch:6.6
-rw-r--r-- | src/com/vaadin/ui/AbstractTextField.java | 48 |
1 files changed, 3 insertions, 45 deletions
diff --git a/src/com/vaadin/ui/AbstractTextField.java b/src/com/vaadin/ui/AbstractTextField.java index 622b8d18d9..4ed76d367b 100644 --- a/src/com/vaadin/ui/AbstractTextField.java +++ b/src/com/vaadin/ui/AbstractTextField.java @@ -1,4 +1,4 @@ -/* +/* @ITMillApache2LicenseForJavaFiles@ */ @@ -123,20 +123,7 @@ public abstract class AbstractTextField extends AbstractField implements throw new IllegalStateException( "Null values are not allowed if the null-representation is null"); } - - if (requestRepaintInTextChangeEvent && !valueChangeInTextChangeEvent) { - /* - * If the repaint occurred in a text change event then we do not - * want to send back the old value since it will just overwrite the - * typed value so we send the last known value instead which is - * updated by the text change event. - */ - target.addVariable(this, "text", lastKnownTextContent); - } else { - target.addVariable(this, "text", value); - } - requestRepaintInTextChangeEvent = false; - valueChangeInTextChangeEvent = false; + target.addVariable(this, "text", value); if (selectionPosition != -1) { target.addAttribute("selpos", selectionPosition); @@ -184,22 +171,6 @@ public abstract class AbstractTextField extends AbstractField implements } } - /** - * Flag for monitoring if a repaint gets requested in a text change event - */ - private boolean requestRepaintInTextChangeEvent = false; - - @Override - public void requestRepaint() { - if (textChangeEventPending) { - /* - * Textchange event listener triggered this repaint - */ - requestRepaintInTextChangeEvent = true; - } - super.requestRepaint(); - } - @Override public void changeVariables(Object source, Map<String, Object> variables) { changingVariables = true; @@ -467,26 +438,13 @@ public abstract class AbstractTextField extends AbstractField implements private void firePendingTextChangeEvent() { if (textChangeEventPending) { - fireEvent(new TextChangeEventImpl(this)); textChangeEventPending = false; + fireEvent(new TextChangeEventImpl(this)); } } - /** - * Flag for monitoring if the value got changed in a TextChangeEvent - * listener - */ - protected boolean valueChangeInTextChangeEvent = false; - @Override protected void setInternalValue(Object newValue) { - if (textChangeEventPending) { - /* - * Value changed in a TextChangeEvent listener - */ - valueChangeInTextChangeEvent = true; - } - if (changingVariables && !textChangeEventPending) { /* * Fire a "simulated" text change event before value change event if |