/** * @see org.opencms.widgets.I_CmsWidget#getDialogWidget(org.opencms.file.CmsObject, org.opencms.widgets.I_CmsWidgetDialog, org.opencms.widgets.I_CmsWidgetParameter) */ public String getDialogWidget(CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param) { String id = param.getId(); StringBuffer result = new StringBuffer(16); result.append("<td class=\"xmlTd\">"); // get select box options from default value String List<CmsSelectWidgetOption> options = parseSelectOptions(cms, widgetDialog, param); String selected = getSelectedValue(cms, param); Iterator<CmsSelectWidgetOption> i = options.iterator(); while (i.hasNext()) { CmsSelectWidgetOption option = i.next(); // create the option result.append("<input type='radio' name='"); result.append(id); result.append("' value='"); result.append(option.getValue()); result.append("'"); if (selected.indexOf(option.getValue()) >= 0) { result.append(" checked"); } result.append(">"); result.append(option.getOption()); result.append("<br>"); } result.append("</td>"); return result.toString(); }
/** * @see org.opencms.widgets.I_CmsWidget#getDialogWidget(org.opencms.file.CmsObject, org.opencms.widgets.I_CmsWidgetDialog, org.opencms.widgets.I_CmsWidgetParameter) */ public String getDialogWidget(CmsObject cms, I_CmsWidgetDialog widgetDialog, I_CmsWidgetParameter param) { String id = param.getId(); StringBuffer result = new StringBuffer(16); result.append("<td class=\"xmlTd\">"); // get select box options from default value String List options = parseSelectOptions(cms, widgetDialog, param); String selected = getSelectedValue(cms, param); Iterator i = options.iterator(); while (i.hasNext()) { CmsSelectWidgetOption option = (CmsSelectWidgetOption)i.next(); // create the option result.append("<input type='radio' name='"); result.append(id); result.append("' value='"); result.append(option.getValue()); result.append("'"); if (selected.indexOf(option.getValue()) >= 0) { result.append(" checked"); } result.append(">"); result.append(option.getOption()); result.append("<br>"); } result.append("</td>"); return result.toString(); }