summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorMika Murtojärvi <mika@vaadin.com>2015-06-17 07:56:55 +0000
committerArtur Signell <artur@vaadin.com>2015-06-17 08:00:36 +0000
commit3a8b97e3697fb7df0c3f54f813e2018168ef05a7 (patch)
tree618bd00fdd404e683da7f37f7e770f59b368a288 /server
parent6c759028b2e4edf5280fb66517c8fe1c7660ecf8 (diff)
downloadvaadin-framework-3a8b97e3697fb7df0c3f54f813e2018168ef05a7.tar.gz
vaadin-framework-3a8b97e3697fb7df0c3f54f813e2018168ef05a7.zip
Revert "Prevent field from updating when removing text change listener. (#16270)"
This reverts commit 4af793d06a0f4a6577aad13403ca7982c6fce224. Test ConverterThatEnforcesAFormatTest.checkElaborating is broken by this change. Change-Id: I8243f6a7bff6d7011d402bce4b614f7d2e4206fd
Diffstat (limited to 'server')
-rw-r--r--server/src/com/vaadin/ui/AbstractTextField.java33
1 files changed, 18 insertions, 15 deletions
diff --git a/server/src/com/vaadin/ui/AbstractTextField.java b/server/src/com/vaadin/ui/AbstractTextField.java
index 14c135228c..93025ac0fd 100644
--- a/server/src/com/vaadin/ui/AbstractTextField.java
+++ b/server/src/com/vaadin/ui/AbstractTextField.java
@@ -126,22 +126,25 @@ public abstract class AbstractTextField extends AbstractField<String> implements
selectionPosition = -1;
}
- target.addAttribute(TextFieldConstants.ATTR_TEXTCHANGE_EVENTMODE,
- getTextChangeEventMode().toString());
- target.addAttribute(TextFieldConstants.ATTR_TEXTCHANGE_TIMEOUT,
- getTextChangeTimeout());
- if (lastKnownTextContent != null) {
- /*
- * The field has be repainted for some reason (e.g. caption, size,
- * stylename), but the value has not been changed since the last
- * text change event. Let the client side know about the value the
- * server side knows. Client side may then ignore the actual value,
- * depending on its state.
- */
- target.addAttribute(
- TextFieldConstants.ATTR_NO_VALUE_CHANGE_BETWEEN_PAINTS,
- true);
+ if (hasListeners(TextChangeEvent.class)) {
+ target.addAttribute(TextFieldConstants.ATTR_TEXTCHANGE_EVENTMODE,
+ getTextChangeEventMode().toString());
+ target.addAttribute(TextFieldConstants.ATTR_TEXTCHANGE_TIMEOUT,
+ getTextChangeTimeout());
+ if (lastKnownTextContent != null) {
+ /*
+ * The field has be repainted for some reason (e.g. caption,
+ * size, stylename), but the value has not been changed since
+ * the last text change event. Let the client side know about
+ * the value the server side knows. Client side may then ignore
+ * the actual value, depending on its state.
+ */
+ target.addAttribute(
+ TextFieldConstants.ATTR_NO_VALUE_CHANGE_BETWEEN_PAINTS,
+ true);
+ }
}
+
}
@Override