summaryrefslogtreecommitdiffstats
path: root/server/src/com/vaadin
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/com/vaadin')
-rw-r--r--server/src/com/vaadin/ui/Slider.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/server/src/com/vaadin/ui/Slider.java b/server/src/com/vaadin/ui/Slider.java
index e63fdc5e10..44fc49ba9b 100644
--- a/server/src/com/vaadin/ui/Slider.java
+++ b/server/src/com/vaadin/ui/Slider.java
@@ -16,6 +16,8 @@
package com.vaadin.ui;
+import org.json.JSONException;
+
import com.vaadin.shared.ui.slider.SliderOrientation;
import com.vaadin.shared.ui.slider.SliderServerRpc;
import com.vaadin.shared.ui.slider.SliderState;
@@ -32,6 +34,21 @@ public class Slider extends AbstractField<Double> {
@Override
public void valueChanged(double value) {
+ /*
+ * Client side updates the state before sending the event so we need
+ * to make sure the cached state is updated to match the client. If
+ * we do not do this, a reverting setValue() call in a listener will
+ * not cause the new state to be sent to the client.
+ *
+ * See #12133.
+ */
+ try {
+ getUI().getConnectorTracker().getDiffState(Slider.this)
+ .put("value", value);
+ } catch (JSONException e) {
+ throw new RuntimeException(e);
+ }
+
try {
setValue(value, true);
} catch (final ValueOutOfBoundsException e) {