*/
protected void parserTableTbody(int columnCount, TableElementTag tableContainer, Grid g) throws AppException {
TableTrElementTag tableTrElement;
DivElementTag contentDiv;
TableTdElementTag tableTdElement;
TableElementTag tableElement;
DivElementTag tableDiv;
// 表格内容
tableTrElement = new TableTrElementTag();
TableTdElementTag tdContainer = new TableTdElementTag();
tdContainer.setColspan(String.valueOf(columnCount));
tableTrElement.addChildrenTag(tdContainer);
tableContainer.addChildrenTag(tableTrElement);
tableDiv = new DivElementTag(g.id() + _CONTENT_TABLE_DIV_ID, _BODY_CONTAINER_CSS);
// 填充实体bean中的数据
// 表格元素
tableElement = new TableElementTag(g.id() + _CONTENT_TABLE_ID, _INPUT_TABLE_CONTENT_CSS);
List tableData = super.getParser().getGridValue(g.id());
if (tableData != null) {
int idx = 0;
String cssClass = null;
for (Object obj : tableData) {
if (idx++ % 2 == 0) {
cssClass = _DOUBLE_TR_CSS;
} else {
cssClass = _SINGLE_TR_CSS;
}
tableTrElement = new TableTrElementTag(g.id() + _CONTENT_TABLE_TR_ID + idx, cssClass);
// 解析表格选择框
parserCheckboxElement(g, idx, tableTrElement);
for (Element e : g.columns()) {
tableTdElement = new TableTdElementTag(e.id() + _CONTENT_TABLE_TD_ID);
contentDiv = new DivElementTag(e.id() + _CONTENT_DIV_ID, _CONTENT_DIV_CSS);
// 解析单元素
parserElement(g.id(), e, contentDiv, null, null, super.getParser().invokeValue(obj, e));
tableTdElement.addChildrenTag(contentDiv);
tableTrElement.addChildrenTag(tableTdElement);
}
tableElement.addChildrenTag(tableTrElement);
}
}
tableDiv.addChildrenTag(tableElement);
tdContainer.addChildrenTag(tableDiv);
}