public static String displayDefaultEmptyValue() { return displayEmptyValue("____________"); }
/** * @see org.openmrs.module.htmlformentry.widget.Widget#generateHtml(org.openmrs.module.htmlformentry.FormEntryContext) */ @Override public String generateHtml(FormEntryContext context) { StringBuilder sb = new StringBuilder(); if (context.getMode() == Mode.VIEW) { String labelString = ""; if (label != null) labelString = " " + label; if (initialValue != null) { sb.append(WidgetFactory.displayValue("[X]" + labelString)); } else { sb.append(WidgetFactory.displayEmptyValue("[  ]" + labelString)); } } else { sb.append("<input type=\"checkbox\" id=\"").append(context.getFieldName(this)).append("\" name=\"").append(context.getFieldName(this)) .append("\" value=\"").append(value).append("\""); if (initialValue != null && !"".equals(initialValue)) sb.append(" checked=\"true\""); if (toggleTarget != null && toggleTarget.trim().length() > 0) sb.append(" toggle" + (toggleDimInd ? "Dim" : "Hide") + "=\"" + toggleTarget + "\""); sb.append("/>"); if (label != null) sb.append("<label for=\"").append(context.getFieldName(this)).append("\">").append(label).append("</label>"); sb.append("<input type=\"hidden\" name=\"_").append(context.getFieldName(this)).append("\"/>"); } return sb.toString(); }
} else { toPrint = "________"; return WidgetFactory.displayEmptyValue(toPrint);
return WidgetFactory.displayComplexValue(initialValue); } else { return WidgetFactory.displayEmptyValue(""); } else { sb.append("/>"); return WidgetFactory.displayEmptyValue("") + sb.toString();
return WidgetFactory.displayEmptyValue(toPrint);
} else { toPrint = "____"; return WidgetFactory.displayEmptyValue(toPrint);
sb.append(WidgetFactory.displayValue("[X] " + opt.getLabel())); } else { sb.append(WidgetFactory.displayEmptyValue("[  ] " + opt.getLabel()));
return WidgetFactory.displayValue(toPrint); } else { return WidgetFactory.displayEmptyValue("___________");