diff options
author | Artem Godin <artem@vaadin.com> | 2013-10-07 17:19:57 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2013-10-08 07:27:48 +0000 |
commit | 3cba6bf847df3fab77cec04dcd2586c76316fd74 (patch) | |
tree | f6e9b25dbed0422979decea7f27ebea03c1cdc48 /client | |
parent | 10bcbdc652c6a61a0adbb8a8b357402ab1b65e2f (diff) | |
download | vaadin-framework-3cba6bf847df3fab77cec04dcd2586c76316fd74.tar.gz vaadin-framework-3cba6bf847df3fab77cec04dcd2586c76316fd74.zip |
Rebuild OptionGroup on HtmlContentAllowed/Multiselect changes (#10451)
Fixes regression with HtmlContent in Safari 5 and changing of
Multiselect properties on the fly.
Change-Id: I4a3820eba8d1c06460777340ea36b1df31b38983
Diffstat (limited to 'client')
-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 |