diff options
author | Artem Godin <artem@vaadin.com> | 2013-10-07 17:19:57 +0300 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2013-10-08 10:29:19 +0300 |
commit | 3632905b08dd9bc1f28808f7ef95a321a124244f (patch) | |
tree | 3c284eb6ac576325ed9f91c52fea19a6dfd71c15 | |
parent | 0249fe09cd0eed1a24560c7e920962f5d257c50b (diff) | |
download | vaadin-framework-3632905b08dd9bc1f28808f7ef95a321a124244f.tar.gz vaadin-framework-3632905b08dd9bc1f28808f7ef95a321a124244f.zip |
Rebuild OptionGroup on HtmlContentAllowed/Multiselect changes (#10451)7.1.7
Fixes regression with HtmlContent in Safari 5 and changing of
Multiselect properties on the fly.
Change-Id: I4a3820eba8d1c06460777340ea36b1df31b38983
-rw-r--r-- | client/src/com/vaadin/client/ui/VOptionGroup.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/client/src/com/vaadin/client/ui/VOptionGroup.java b/client/src/com/vaadin/client/ui/VOptionGroup.java index 455c7669f5..fee1c313f5 100644 --- a/client/src/com/vaadin/client/ui/VOptionGroup.java +++ b/client/src/com/vaadin/client/ui/VOptionGroup.java @@ -87,11 +87,16 @@ public class VOptionGroup extends VOptionGroupBase implements FocusHandler, /** For internal use only. May be removed or replaced in the future. */ public boolean htmlContentAllowed = false; + private boolean wasHtmlContentAllowed = false; + private boolean wasMultiselect = false; + public VOptionGroup() { super(CLASSNAME); panel = (Panel) optionsContainer; optionsToKeys = new HashMap<CheckBox, String>(); optionsEnabled = new ArrayList<Boolean>(); + + wasMultiselect = isMultiselect(); } /* @@ -143,7 +148,11 @@ public class VOptionGroup extends VOptionGroupBase implements FocusHandler, String key = opUidl.getStringAttribute("key"); CheckBox op = keysToOptions.get(key); - if (op == null) { + + // Need to recreate object if isMultiselect is changed (#10451) + // OR if htmlContentAllowed changed due to Safari 5 issue + if ((op == null) || (htmlContentAllowed != wasHtmlContentAllowed) + || (isMultiselect() != wasMultiselect)) { // Create a new element if (isMultiselect()) { op = new VCheckBox(); @@ -184,6 +193,9 @@ public class VOptionGroup extends VOptionGroupBase implements FocusHandler, panel.add(wid); } } + + wasHtmlContentAllowed = htmlContentAllowed; + wasMultiselect = isMultiselect(); } @Override |