use of com.github.bordertech.wcomponents.WTable.TableModel in project wcomponents by BorderTech.
the class WTableRenderer method paintRows.
/**
* Paints the rows of the table.
*
* @param table the table to paint the rows for.
* @param renderContext the RenderContext to paint to.
*/
private void paintRows(final WTable table, final WebXmlRenderContext renderContext) {
XmlStringBuilder xml = renderContext.getWriter();
TableModel model = table.getTableModel();
xml.appendTagOpen("ui:tbody");
xml.appendAttribute("id", table.getId() + ".body");
xml.appendClose();
if (model.getRowCount() == 0) {
xml.appendTag("ui:nodata");
xml.appendEscaped(table.getNoDataMessage());
xml.appendEndTag("ui:nodata");
} else {
// If has at least one visible col, paint the rows.
final int columnCount = table.getColumnCount();
for (int i = 0; i < columnCount; i++) {
if (table.getColumn(i).isVisible()) {
doPaintRows(table, renderContext);
break;
}
}
}
xml.appendEndTag("ui:tbody");
}
Aggregations