diff options
author | Matti Tahvonen <matti.tahvonen@itmill.com> | 2011-10-06 20:49:48 +0000 |
---|---|---|
committer | Matti Tahvonen <matti.tahvonen@itmill.com> | 2011-10-06 20:49:48 +0000 |
commit | beda2ff1f09a4dc3dd4ae002aeb8b145b01e3e1e (patch) | |
tree | d55b9854f0d5c3fe75977cac569bcc921c574fbe | |
parent | 51c04a285ac26286dc6327a3c212acd2cabc44e9 (diff) | |
download | vaadin-framework-beda2ff1f09a4dc3dd4ae002aeb8b145b01e3e1e.tar.gz vaadin-framework-beda2ff1f09a4dc3dd4ae002aeb8b145b01e3e1e.zip |
reverted #6588 fix, causes rather bad regressions
svn changeset:21621/svn branch:6.7
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ui/VTextField.java | 17 | ||||
-rw-r--r-- | src/com/vaadin/ui/AbstractTextField.java | 34 |
2 files changed, 3 insertions, 48 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTextField.java b/src/com/vaadin/terminal/gwt/client/ui/VTextField.java index a1ae13249f..8bc655f39f 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VTextField.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VTextField.java @@ -64,7 +64,6 @@ public class VTextField extends TextBoxBase implements Paintable, Field, private static final String CLASSNAME_PROMPT = "prompt"; private static final String ATTR_INPUTPROMPT = "prompt"; public static final String ATTR_TEXTCHANGE_TIMEOUT = "iet"; - public static final String ATTR_TEXT_CHANGED = "textChanged"; public static final String VAR_CURSOR = "c"; public static final String ATTR_TEXTCHANGE_EVENTMODE = "iem"; private static final String TEXTCHANGE_MODE_EAGER = "EAGER"; @@ -202,9 +201,6 @@ public class VTextField extends TextBoxBase implements Paintable, Field, } public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { - // Required to always check text value sent from server when initalizing - // even if server did not send ATTR_TEXT_CHANGED - boolean firstPaint = (this.client == null); this.client = client; id = uidl.getId(); @@ -248,17 +244,8 @@ public class VTextField extends TextBoxBase implements Paintable, Field, setColumns(new Integer(uidl.getStringAttribute("cols")).intValue()); } - final String text; - if (uidl.hasVariable("text") - && (firstPaint || (uidl.hasAttribute(ATTR_TEXT_CHANGED) && uidl - .getBooleanAttribute(ATTR_TEXT_CHANGED)))) { - // Use value from UIDL if this is the first time the component is - // painted or if something has changed on the server - text = uidl.getStringVariable("text"); - } else { - // Use what we already have if no change from the server - text = prompting ? null : getText(); - } + final String text = uidl.hasVariable("text") ? uidl + .getStringVariable("text") : null; setPrompting(inputPrompt != null && focusedTextField != this && (text == null || text.equals(""))); diff --git a/src/com/vaadin/ui/AbstractTextField.java b/src/com/vaadin/ui/AbstractTextField.java index e31efb85c2..4ed76d367b 100644 --- a/src/com/vaadin/ui/AbstractTextField.java +++ b/src/com/vaadin/ui/AbstractTextField.java @@ -92,12 +92,6 @@ public abstract class AbstractTextField extends AbstractField implements */ private boolean changingVariables; - /** - * Track whether the value on the server has actually changed to avoid - * updating the text in the input element on every repaint - */ - private boolean localValueChanged = true; - protected AbstractTextField() { super(); } @@ -129,11 +123,6 @@ public abstract class AbstractTextField extends AbstractField implements throw new IllegalStateException( "Null values are not allowed if the null-representation is null"); } - - if (localValueChanged) { - target.addAttribute(VTextField.ATTR_TEXT_CHANGED, true); - localValueChanged = false; - } target.addVariable(this, "text", value); if (selectionPosition != -1) { @@ -224,8 +213,7 @@ public abstract class AbstractTextField extends AbstractField implements if (newValue != oldValue && (newValue == null || !newValue.equals(oldValue))) { boolean wasModified = isModified(); - // Don't update the local change flag - super.setValue(newValue, true); + setValue(newValue, true); // If the modified status changes, or if we have a // formatter, repaint is needed after all. @@ -250,26 +238,6 @@ public abstract class AbstractTextField extends AbstractField implements } @Override - protected void setValue(Object newValue, boolean repaintIsNotNeeded) - throws ReadOnlyException, ConversionException { - if (notEqual(newValue, getValue()) - || notEqual(newValue, lastKnownTextContent)) { - // The client should use the new value - localValueChanged = true; - if (!repaintIsNotNeeded) { - // Repaint even if super.setValue doesn't detect any change - requestRepaint(); - } - } - super.setValue(newValue, repaintIsNotNeeded); - } - - private static boolean notEqual(Object newValue, Object oldValue) { - return oldValue != newValue - && (newValue == null || !newValue.equals(oldValue)); - } - - @Override public Class getType() { return String.class; } |