diff options
author | Henri Sara <hesara@vaadin.com> | 2015-11-05 13:29:15 +0200 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2016-08-08 08:23:59 +0000 |
commit | 07292fe8fb7b9d9cf94dd3a57cfab4e6e31bd639 (patch) | |
tree | db420094268dbf97e902f57420b7627d097f9e09 /server/src | |
parent | 9207d3f3442a6ab6b9fda29d8a76e2bee4929ab1 (diff) | |
download | vaadin-framework-07292fe8fb7b9d9cf94dd3a57cfab4e6e31bd639.tar.gz vaadin-framework-07292fe8fb7b9d9cf94dd3a57cfab4e6e31bd639.zip |
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
Diffstat (limited to 'server/src')
-rw-r--r-- | server/src/main/java/com/vaadin/ui/ComboBox.java | 17 |
1 files changed, 9 insertions, 8 deletions
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 |