int kidIndex,
int rowSpan
) throws IOException
{
ResponseWriter writer = context.getResponseWriter();
ColumnData colData = tContext.getColumnData();
final int physicalIndex = colData.getPhysicalColumnIndex();
final boolean isRowHeader = colData.isRowHeader(physicalIndex);
final String cellClass;
final String borderStyleClass;
if (isRowHeader)
{
writer.startElement(XhtmlConstants.TABLE_HEADER_ELEMENT, column);
cellClass = TableRenderer.getRowHeaderFormatClass();
if (tContext.isExplicitHeaderIDMode())
{
String headerID = column.getClientId(context);
RowData rowData = tContext.getRowData();
rowData.setCurrentRowHeaderID(headerID);
writer.writeAttribute(XhtmlConstants.ID_ATTRIBUTE, headerID, null);
}
else
{
writer.writeAttribute("scope", "row", null);
}
borderStyleClass =
CellUtils.getHeaderBorderStyle(tContext, rc, false, false);
}
else // !isRowHeader
{
writer.startElement(XhtmlConstants.TABLE_DATA_ELEMENT, column);
cellClass = getTableDataStyleClass(tContext);
renderHeadersAttr(context, tContext);
borderStyleClass = CellUtils.getDataBorderStyle(rc, tContext);
} // endif (isRowHeader)
FacesBean bean = getFacesBean(column);
String userStyleClass = getStyleClass(column, bean);
String userInlineStyle = getInlineStyle(column, bean);
// Currently, a column's width is rendered in the column's header (<TH>).
// In cases where all columns of a table have empty headersTexts, no
// column header is rendered. Hence, a column's width is not supported
// in the aforementioned case.
// To fix this problem, lets render the column's width in the
// column's data-element (<TD>) that is in the first row.
Object width = tContext.getColumnWidth(physicalIndex);
if ((!tContext.hasColumnHeaders()) && (width!= null))
{
int row = tContext.getRowData().getRangeIndex();
// Find the data element in the first row. Also, if there are
// subrows, it enough to render the width for the first subrow
if ((row == 0) && (kidIndex < 1))
{
writer.writeAttribute("width", width, null);
}
}
renderStyleClasses(context, rc, new String[]{userStyleClass, cellClass, borderStyleClass});
writer.writeAttribute("style", userInlineStyle, null);
if (colData.getNoWrap(physicalIndex) && !getShouldWrap())
writer.writeAttribute(XhtmlConstants.NOWRAP_ATTRIBUTE, Boolean.TRUE, null);
CellUtils.renderSpan(context, true /*isRowSpan*/, rowSpan);
_renderKids(context, rc, tContext, column, kidIndex);