From 07292fe8fb7b9d9cf94dd3a57cfab4e6e31bd639 Mon Sep 17 00:00:00 2001 From: Henri Sara Date: Thu, 5 Nov 2015 13:29:15 +0200 Subject: Send ComboBox focus/blur with RPC (#19929) Send focus and blur events using RPC instead of in UIDL. This change does not use ConnectorFocusAndBlurHandler to preserve old timings. Change-Id: I02a86dcc3959388ca835798a33cb600898b19ab9 --- server/src/main/java/com/vaadin/ui/ComboBox.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'server/src') diff --git a/server/src/main/java/com/vaadin/ui/ComboBox.java b/server/src/main/java/com/vaadin/ui/ComboBox.java index bb87aed0bb..e6b7b2be94 100644 --- a/server/src/main/java/com/vaadin/ui/ComboBox.java +++ b/server/src/main/java/com/vaadin/ui/ComboBox.java @@ -29,6 +29,7 @@ import com.vaadin.data.util.filter.SimpleStringFilter; import com.vaadin.event.FieldEvents; import com.vaadin.event.FieldEvents.BlurEvent; import com.vaadin.event.FieldEvents.BlurListener; +import com.vaadin.event.FieldEvents.FocusAndBlurServerRpcImpl; import com.vaadin.event.FieldEvents.FocusEvent; import com.vaadin.event.FieldEvents.FocusListener; import com.vaadin.server.PaintException; @@ -90,6 +91,13 @@ public class ComboBox extends AbstractSelect implements } }; + FocusAndBlurServerRpcImpl focusBlurRpc = new FocusAndBlurServerRpcImpl(this) { + @Override + protected void fireEvent(Component.Event event) { + ComboBox.this.fireEvent(event); + } + }; + /** * Holds value of property pageLength. 0 disables paging. */ @@ -170,6 +178,7 @@ public class ComboBox extends AbstractSelect implements */ private void init() { registerRpc(rpc); + registerRpc(focusBlurRpc); setNewItemsAllowed(false); setImmediate(true); @@ -759,14 +768,6 @@ public class ComboBox extends AbstractSelect implements } requestRepaint(); } - - if (variables.containsKey(FocusEvent.EVENT_ID)) { - fireEvent(new FocusEvent(this)); - } - if (variables.containsKey(BlurEvent.EVENT_ID)) { - fireEvent(new BlurEvent(this)); - } - } @Override -- cgit v1.2.3