diff options
author | Teemu Suo-Anttila <teemusa@vaadin.com> | 2017-03-06 15:46:39 +0200 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-03-07 12:36:54 +0200 |
commit | 5081392bfdf6b74915952a64d1070255f7268457 (patch) | |
tree | 844b30924068616ea350da97a27966d16d5c9380 /compatibility-client | |
parent | 7646cfa49baeb4029b4af74b3da97b61b3363215 (diff) | |
download | vaadin-framework-5081392bfdf6b74915952a64d1070255f7268457.tar.gz vaadin-framework-5081392bfdf6b74915952a64d1070255f7268457.zip |
Revert html content through shared state for OptionGroup
Diffstat (limited to 'compatibility-client')
-rw-r--r-- | compatibility-client/src/main/java/com/vaadin/v7/client/ui/VOptionGroup.java | 18 | ||||
-rw-r--r-- | compatibility-client/src/main/java/com/vaadin/v7/client/ui/optiongroup/OptionGroupConnector.java | 5 |
2 files changed, 9 insertions, 14 deletions
diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VOptionGroup.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VOptionGroup.java index b67edfe93c..ee9048d4c2 100644 --- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VOptionGroup.java +++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VOptionGroup.java @@ -87,7 +87,8 @@ public class VOptionGroup extends VOptionGroupBase */ private boolean blurOccured = false; - private boolean htmlContentAllowed = false; + /** For internal use only. May be removed or replaced in the future. */ + public boolean htmlContentAllowed = false; private boolean wasHtmlContentAllowed = false; private boolean wasMultiselect = false; @@ -137,7 +138,7 @@ public class VOptionGroup extends VOptionGroupBase final UIDL opUidl = (UIDL) it.next(); String itemHtml = opUidl.getStringAttribute("caption"); - if (!isHtmlContentAllowed()) { + if (!htmlContentAllowed) { itemHtml = WidgetUtil.escapeHTML(itemHtml); } @@ -152,8 +153,7 @@ public class VOptionGroup extends VOptionGroupBase // Need to recreate object if isMultiselect is changed (#10451) // OR if htmlContentAllowed changed due to Safari 5 issue - if ((op == null) - || (isHtmlContentAllowed() != wasHtmlContentAllowed) + if ((op == null) || (htmlContentAllowed != wasHtmlContentAllowed) || (isMultiselect() != wasMultiselect)) { // Create a new element if (isMultiselect()) { @@ -195,7 +195,7 @@ public class VOptionGroup extends VOptionGroupBase } } - wasHtmlContentAllowed = isHtmlContentAllowed(); + wasHtmlContentAllowed = htmlContentAllowed; wasMultiselect = isMultiselect(); } @@ -311,12 +311,4 @@ public class VOptionGroup extends VOptionGroupBase }); } } - - public boolean isHtmlContentAllowed() { - return htmlContentAllowed; - } - - public void setHtmlContentAllowed(boolean htmlContentAllowed) { - this.htmlContentAllowed = htmlContentAllowed; - } } diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/optiongroup/OptionGroupConnector.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/optiongroup/OptionGroupConnector.java index dbed217598..097f38f4d1 100644 --- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/optiongroup/OptionGroupConnector.java +++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/optiongroup/OptionGroupConnector.java @@ -26,6 +26,7 @@ import com.vaadin.client.UIDL; import com.vaadin.shared.EventId; import com.vaadin.shared.ui.Connect; import com.vaadin.v7.client.ui.VOptionGroup; +import com.vaadin.v7.shared.ui.optiongroup.OptionGroupConstants; import com.vaadin.v7.shared.ui.optiongroup.OptionGroupState; import com.vaadin.v7.ui.OptionGroup; @@ -34,7 +35,9 @@ public class OptionGroupConnector extends OptionGroupBaseConnector { @Override public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { - // HTML Content has been moved to state. + getWidget().htmlContentAllowed = uidl + .hasAttribute(OptionGroupConstants.HTML_CONTENT_ALLOWED); + super.updateFromUIDL(uidl, client); getWidget().sendFocusEvents = client.hasEventListeners(this, |