public void render(Renderer renderer, StringOutput target, Component source, URLBuilder ubu, Translator translator,
RenderResult renderResult, String[] args) {
// Get the model object
Choice choice = (Choice) source;
TableDataModel tdm = choice.getTableDataModel();
boolean iframePostEnabled = renderer.getGlobalSettings().getAjaxFlags().isIframePostEnabled();
// form header
String id = choice.getComponentName() + "_" + choice.hashCode();
target.append("<form method=\"post\" name=\"").append(id).append("\" id=\"").append(id).append("\" action=\"");
ubu.buildURI(target, null, null, iframePostEnabled? AJAXFlags.MODE_TOBGIFRAME : AJAXFlags.MODE_NORMAL);
target.append("\"");
if (iframePostEnabled) {
ubu.appendTarget(target);
}
target.append("/>");
target.append("<table class=\"b_choice\">");
int rows = tdm.getRowCount();
int cols = tdm.getColumnCount();
for (int i = 0; i < rows; i++) {
target.append("<tr>");
for (int j = 0; j < cols; j++) {
Object val = tdm.getValueAt(i, j);
if (j == 0) { // column with on/off Boolean
target.append("<td class=\"b_choice_checkrow\">");
boolean selected = ((Boolean) val).booleanValue();
String keyN = "c" + i;
target.append("<input type=\"checkbox\" class=\"b_checkbox\"");