From 7bda912a77f6295ac339a3035b0de8d7ed45cfa3 Mon Sep 17 00:00:00 2001 From: Zhe Sun <31067185+ZheSun88@users.noreply.github.com> Date: Fri, 14 Jun 2019 15:31:44 +0300 Subject: Separates a rpc for handling the client event order in DateTimeField (#11574) * Using @Delayed annotation for DateField Rpc * Separate a rpc for handling the time change in DateTimeField * Add test case for wrong event order --- .../ui/datefield/AbstractDateFieldServerRpc.java | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'shared') diff --git a/shared/src/main/java/com/vaadin/shared/ui/datefield/AbstractDateFieldServerRpc.java b/shared/src/main/java/com/vaadin/shared/ui/datefield/AbstractDateFieldServerRpc.java index e82c45f171..0344110443 100644 --- a/shared/src/main/java/com/vaadin/shared/ui/datefield/AbstractDateFieldServerRpc.java +++ b/shared/src/main/java/com/vaadin/shared/ui/datefield/AbstractDateFieldServerRpc.java @@ -17,6 +17,7 @@ package com.vaadin.shared.ui.datefield; import java.util.Map; +import com.vaadin.shared.annotations.Delayed; import com.vaadin.shared.communication.ServerRpc; /** @@ -41,6 +42,27 @@ public interface AbstractDateFieldServerRpc extends ServerRpc { */ void update(String newDateString, Map resolutions); + /** + * Updates the typed data string and resolution names and values with + * delayed rpc. The rpc will be sent by triggering another non + * {@link Delayed} annotated rpc. + * + * @since + * + * @param newDateString + * the value of the text field part. It enables analyzing invalid + * input on the server. {@code null} if the date was chosen with + * popup calendar or contains user-typed string + * @param resolutions + * map of time unit (resolution) name and value, the key is the + * resolution name e.g. "HOUR", "MINUTE", the value can be + * {@code null}. If the map is empty, that means the + * {@code newDateString} is invalid + */ + @Delayed(lastOnly = true) + void updateValueWithDelay(String newDateString, + Map resolutions); + /** * Indicates to the server that the client-side has lost focus. */ -- cgit v1.2.3