diff options
Diffstat (limited to 'server/src/main/java/com/vaadin/ui/AbstractTextField.java')
-rw-r--r-- | server/src/main/java/com/vaadin/ui/AbstractTextField.java | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/server/src/main/java/com/vaadin/ui/AbstractTextField.java b/server/src/main/java/com/vaadin/ui/AbstractTextField.java index 3b2c0e9914..831b0ba6c6 100644 --- a/server/src/main/java/com/vaadin/ui/AbstractTextField.java +++ b/server/src/main/java/com/vaadin/ui/AbstractTextField.java @@ -199,10 +199,8 @@ public abstract class AbstractTextField extends AbstractField<String> * @see Registration */ public Registration addFocusListener(FocusListener listener) { - addListener(FocusEvent.EVENT_ID, FocusEvent.class, listener, + return addListener(FocusEvent.EVENT_ID, FocusEvent.class, listener, FocusListener.focusMethod); - return () -> removeListener(FocusEvent.EVENT_ID, FocusEvent.class, - listener); } /** @@ -216,10 +214,8 @@ public abstract class AbstractTextField extends AbstractField<String> * @see Registration */ public Registration addBlurListener(BlurListener listener) { - addListener(BlurEvent.EVENT_ID, BlurEvent.class, listener, + return addListener(BlurEvent.EVENT_ID, BlurEvent.class, listener, BlurListener.blurMethod); - return () -> removeListener(BlurEvent.EVENT_ID, BlurEvent.class, - listener); } @Override @@ -281,8 +277,7 @@ public abstract class AbstractTextField extends AbstractField<String> @Override public void writeDesign(Element design, DesignContext designContext) { super.writeDesign(design, designContext); - AbstractTextField def = designContext - .getDefaultInstance(this); + AbstractTextField def = designContext.getDefaultInstance(this); Attributes attr = design.attributes(); DesignAttributeHandler.writeAttribute("maxlength", attr, getMaxLength(), def.getMaxLength(), Integer.class, designContext); |