public class VOptionGroup extends VOptionGroupBase implements FocusHandler,\r
BlurHandler {\r
\r
- public static final String HTML_CONTENT_ALLOWED = "htmlcontentallowed";\r
+ public static final String HTML_CONTENT_ALLOWED = "usehtml";\r
\r
public static final String CLASSNAME = "v-select-optiongroup";\r
\r
*/\r
private boolean blurOccured = false;\r
\r
- private boolean htmlItems = false;\r
+ private boolean htmlContentAllowed = false;\r
\r
public VOptionGroup() {\r
super(CLASSNAME);\r
\r
@Override\r
public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {\r
- if (uidl.hasAttribute(HTML_CONTENT_ALLOWED)\r
- && uidl.getBooleanAttribute(HTML_CONTENT_ALLOWED)) {\r
- htmlItems = true;\r
- } else {\r
- htmlItems = false;\r
- }\r
+ htmlContentAllowed = uidl.hasAttribute(HTML_CONTENT_ALLOWED);\r
+\r
super.updateFromUIDL(uidl, client);\r
\r
sendFocusEvents = client.hasEventListeners(this, EventId.FOCUS);\r
String caption = opUidl.getStringAttribute("caption");\r
if (isMultiselect()) {\r
op = new VCheckBox();\r
- if (htmlItems) {\r
+ if (htmlContentAllowed) {\r
op.setHTML(caption);\r
} else {\r
op.setText(caption);\r
}\r
} else {\r
- op = new RadioButton(id, caption, htmlItems);\r
+ op = new RadioButton(id, caption, htmlContentAllowed);\r
op.setStyleName("v-radiobutton");\r
}\r
op.addStyleName(CLASSNAME_OPTION);\r
@Override
public void paintContent(PaintTarget target) throws PaintException {
target.addAttribute("type", "optiongroup");
- target.addAttribute(VOptionGroup.HTML_CONTENT_ALLOWED,
- htmlContentAllowed);
+ if (isHtmlContentAllowed()) {
+ target.addAttribute(VOptionGroup.HTML_CONTENT_ALLOWED, true);
+ }
super.paintContent(target);
}