aboutsummaryrefslogtreecommitdiffstats
path: root/server/src/main
diff options
context:
space:
mode:
authorHenri Sara <hesara@vaadin.com>2016-07-14 15:22:39 +0300
committerHenri Sara <hesara@vaadin.com>2016-08-11 17:01:35 +0300
commit8b8752c520c9d2d1f0673b7edf95e56eaeea160f (patch)
treef9421e5251e3bd4d683f3cbdbdd6acb860dbb5b7 /server/src/main
parent5c852b41ff22409e9f69d634f2de5df69b7815c0 (diff)
downloadvaadin-framework-8b8752c520c9d2d1f0673b7edf95e56eaeea160f.tar.gz
vaadin-framework-8b8752c520c9d2d1f0673b7edf95e56eaeea160f.zip
Use shared state for OptionGroup htmlContentAllowed
Change-Id: I626165e19a1b634bd27b2e25efab88066552b190
Diffstat (limited to 'server/src/main')
-rw-r--r--server/src/main/java/com/vaadin/ui/OptionGroup.java19
1 files changed, 7 insertions, 12 deletions
diff --git a/server/src/main/java/com/vaadin/ui/OptionGroup.java b/server/src/main/java/com/vaadin/ui/OptionGroup.java
index a8d0e61a97..af2afeb4ad 100644
--- a/server/src/main/java/com/vaadin/ui/OptionGroup.java
+++ b/server/src/main/java/com/vaadin/ui/OptionGroup.java
@@ -44,7 +44,6 @@ public class OptionGroup extends AbstractSelect implements
FieldEvents.BlurNotifier, FieldEvents.FocusNotifier {
private Set<Object> disabledItemIds = new HashSet<Object>();
- private boolean htmlContentAllowed = false;
public OptionGroup() {
super();
@@ -63,14 +62,6 @@ public class OptionGroup extends AbstractSelect implements
}
@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);
@@ -242,8 +233,7 @@ public class OptionGroup extends AbstractSelect implements
* text
*/
public void setHtmlContentAllowed(boolean htmlContentAllowed) {
- this.htmlContentAllowed = htmlContentAllowed;
- markAsDirty();
+ getState().htmlContentAllowed = htmlContentAllowed;
}
/**
@@ -254,7 +244,7 @@ public class OptionGroup extends AbstractSelect implements
* @see #setHtmlContentAllowed(boolean)
*/
public boolean isHtmlContentAllowed() {
- return htmlContentAllowed;
+ return getState(false).htmlContentAllowed;
}
@Override
@@ -293,4 +283,9 @@ public class OptionGroup extends AbstractSelect implements
protected OptionGroupState getState() {
return (OptionGroupState) super.getState();
}
+
+ @Override
+ protected OptionGroupState getState(boolean markAsDirty) {
+ return (OptionGroupState) super.getState(markAsDirty);
+ }
}