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-server | |
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-server')
-rw-r--r-- | compatibility-server/src/main/java/com/vaadin/v7/ui/OptionGroup.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/compatibility-server/src/main/java/com/vaadin/v7/ui/OptionGroup.java b/compatibility-server/src/main/java/com/vaadin/v7/ui/OptionGroup.java index 34090225ff..a7782b2e50 100644 --- a/compatibility-server/src/main/java/com/vaadin/v7/ui/OptionGroup.java +++ b/compatibility-server/src/main/java/com/vaadin/v7/ui/OptionGroup.java @@ -51,6 +51,7 @@ public class OptionGroup extends AbstractSelect implements FieldEvents.BlurNotifier, FieldEvents.FocusNotifier { private Set<Object> disabledItemIds = new HashSet<Object>(); + private boolean htmlContentAllowed = false; public OptionGroup() { super(); @@ -69,6 +70,15 @@ public class OptionGroup extends AbstractSelect } @Override + public void paintContent(PaintTarget target) throws PaintException { + if (isHtmlContentAllowed()) { + target.addAttribute(OptionGroupConstants.HTML_CONTENT_ALLOWED, + true); + } + super.paintContent(target); + } + + @Override protected void paintItem(PaintTarget target, Object itemId) throws PaintException { super.paintItem(target, itemId); @@ -202,7 +212,8 @@ public class OptionGroup extends AbstractSelect * text */ public void setHtmlContentAllowed(boolean htmlContentAllowed) { - getState().htmlContentAllowed = htmlContentAllowed; + this.htmlContentAllowed = htmlContentAllowed; + markAsDirty(); } /** @@ -213,7 +224,7 @@ public class OptionGroup extends AbstractSelect * @see #setHtmlContentAllowed(boolean) */ public boolean isHtmlContentAllowed() { - return getState(false).htmlContentAllowed; + return htmlContentAllowed; } @Override |