diff options
author | Sauli Tähkäpää <sauli@vaadin.com> | 2015-01-16 23:19:06 +0200 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2015-06-08 14:19:19 +0000 |
commit | 4af793d06a0f4a6577aad13403ca7982c6fce224 (patch) | |
tree | d9f775a64ee8808cd9ecdfe2b40301467ae6b861 /server | |
parent | bfb632bf19f24beda9e0a5e4e6b3438cb532b069 (diff) | |
download | vaadin-framework-4af793d06a0f4a6577aad13403ca7982c6fce224.tar.gz vaadin-framework-4af793d06a0f4a6577aad13403ca7982c6fce224.zip |
Prevent field from updating when removing text change listener. (#16270)
Change-Id: I65c598ae71414550eb648fabf6e94fb1dabbef97
Diffstat (limited to 'server')
-rw-r--r-- | server/src/com/vaadin/ui/AbstractTextField.java | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/server/src/com/vaadin/ui/AbstractTextField.java b/server/src/com/vaadin/ui/AbstractTextField.java index 93025ac0fd..14c135228c 100644 --- a/server/src/com/vaadin/ui/AbstractTextField.java +++ b/server/src/com/vaadin/ui/AbstractTextField.java @@ -126,25 +126,22 @@ public abstract class AbstractTextField extends AbstractField<String> implements selectionPosition = -1; } - 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); - } + 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 |