UIExtendedDataTable table = holder.getTable();
ResponseWriter writer = context.getResponseWriter();
Iterator<UIColumn> iter = table.getSortedColumns();
boolean first = true;
int currentColumn = 0;
UIColumn column = null;
if (holder.isFirstRow()) {
encodeFakeIeRow(context, table, holder);
}
if (holder.isGroupingOn() && (rowGroupChanged(context, holder))) {
encodeGroupRow(context, table, holder);
}
holder.setFirstRow(false);
while (iter.hasNext()) {
column = iter.next();
// Start new row for first column - expect a case of the detail
// table, wich will be insert own row.
boolean isRow = (column instanceof Row);
if (first && !isRow) {
encodeRowStart(context, getFirstRowSkinClass(), holder
.getRowClass(), table, holder, writer);
}
// TODO PKA CHANGE COLUMN RENDERER TO GET RID OF && false
// if (false && (column instanceof Column)) {
// boolean breakBefore = ((Column) column).isBreakBefore()
// || isRow;
// if (breakBefore && !first) {
// // close current row
// writer.endElement(HTML.TR_ELEMENT);
// // reset columns counter.
// currentColumn = 0;
// // Start new row, expect a case of the detail table, wich
// // will be insert own row.
// if (!isRow) {
// holder.nextRow();
// encodeRowStart(context, holder.getRowClass(), table,
// holder, writer);
// }
// }
// encodeCellChildren(context, column,
// first ? getFirstRowSkinClass() : null,
// getRowSkinClass(), holder.getRowClass(),
// getCellSkinClass(), holder
// .getColumnClass(currentColumn));
// // renderChild(context, column);
// if (isRow && iter.hasNext()) {
// // Start new row for remained columns.
// holder.nextRow();
// encodeRowStart(context, holder.getRowClass(), table,
// holder, writer);
// // reset columns counter.
// currentColumn = -1;
// }
// } else
if (column.isRendered()) {
// UIColumn don't have own renderer
writer.startElement(HTML.td_ELEM, table);
getUtils().encodeId(context, column);
encodeStyleClass(writer, null, getCellSkinClass(), holder.getColumnClass(currentColumn),
column.getAttributes().get("styleClass"));
encodeStyle(writer, null, null, null, column.getAttributes().get("style"));
// TODO - encode column attributes.
writer.startElement(HTML.DIV_ELEM, table);
writer.writeAttribute("class", "extdt-cell-div", null);
// IE
renderChildren(context, column);