final RenderingContext arc,
final TreeTableRenderingContext ttrc,
final FacesBean bean)
throws IOException
{
final UIXTreeTable treeTableBase = ttrc.getUIXTreeTable();
final ResponseWriter writer = context.getResponseWriter();
final RowKeySet treeState = treeTableBase.getDisclosedRowKeys();
final int specialColCount = _getSpecialColCount(ttrc);
final boolean rootNodeRendered = isRootNodeRendered(bean);
TableUtils.RowLoop loop = new TableUtils.RowLoop()
{
@Override
protected void loop(FacesContext context, CollectionComponent treeTable)
throws IOException
{
Object focusPath = TreeUtils.getFocusRowKey(treeTableBase);
treeTableBase.setRowKey(focusPath);
processRow(context, treeTable);
}
@Override
protected void processRowImpl(FacesContext context, CollectionComponent treeTable)
throws IOException
{
if (rootNodeRendered || treeTableBase.getDepth() > 0)
{
writer.startElement(XhtmlConstants.TABLE_ROW_ELEMENT, null);
renderSingleRow(context, arc, ttrc, treeTableBase);
writer.endElement(XhtmlConstants.TABLE_ROW_ELEMENT);
}
//
// if (hasInvisibleNodes)
// {
// //context.addHiddenDataObject(treeTableBase.getRowData());
// }
if (treeTableBase.isContainer())
{
if (treeState.isContained() || (rootNodeRendered == false && treeTableBase.getDepth() == 0))
{
treeTableBase.enterContainer();
int rows = treeTableBase.getRows();
int rowCount = treeTableBase.getRowCount();
boolean renderNavRow = (rows > 0) &&
((rowCount < 0) || (rowCount > rows));
if (renderNavRow)
{
renderEmptyTableRow(context, arc, ttrc, specialColCount, _NAV_TOP);
}
super.loop(context, treeTable);
if (renderNavRow)
{
renderEmptyTableRow(context, arc, ttrc, specialColCount, _NAV_BOTTOM);
}
treeTableBase.exitContainer();
}
}
}
};