summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <tsuoanttila@users.noreply.github.com>2017-08-02 09:12:21 +0300
committerHenri Sara <henri.sara@gmail.com>2017-08-02 09:12:21 +0300
commitf12a23c9c6bb176dd0550f07d6ddeb1e91c84bfc (patch)
tree70f177f117b87bcb20d6eb1f3fa46ba45251a976 /client
parent61c3a725bad98b731a8eb6a3186bb66398630022 (diff)
downloadvaadin-framework-f12a23c9c6bb176dd0550f07d6ddeb1e91c84bfc.tar.gz
vaadin-framework-f12a23c9c6bb176dd0550f07d6ddeb1e91c84bfc.zip
Fix RadioButtonGroup selection updates to client (#9749)
This patch provides a simple fix for the majority of issues. There are still issues that should be fixes by refactoring parts of the logic in AbstractSingleSelect. This patch does not unify the handling of empty values in the TestBench elements of various AbstractSingleSelects. Fixes #9494
Diffstat (limited to 'client')
-rw-r--r--client/src/main/java/com/vaadin/client/ui/VRadioButtonGroup.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/client/src/main/java/com/vaadin/client/ui/VRadioButtonGroup.java b/client/src/main/java/com/vaadin/client/ui/VRadioButtonGroup.java
index 7cfaf7572e..1386005351 100644
--- a/client/src/main/java/com/vaadin/client/ui/VRadioButtonGroup.java
+++ b/client/src/main/java/com/vaadin/client/ui/VRadioButtonGroup.java
@@ -227,9 +227,13 @@ public class VRadioButtonGroup extends FocusableFlowPanelComposite
}
public void selectItemKey(String selectedItemKey) {
- RadioButton radioButton = keyToOptions.get(selectedItemKey);
- if (radioButton != null) {// Items might not be loaded yet
- radioButton.setValue(true);
+ if (selectedItemKey != null) {
+ RadioButton radioButton = keyToOptions.get(selectedItemKey);
+ if (radioButton != null) { // Items might not be loaded yet
+ radioButton.setValue(true);
+ }
+ } else {
+ keyToOptions.values().forEach(button -> button.setValue(false));
}
}
}