*/
public void doTag()
throws JspException, IOException {
JspContext jspContext = getJspContext();
DataGridTagModel dgm = DataGridUtil.getDataGridTagModel(jspContext);
if(dgm == null)
throw new JspException(Bundle.getErrorString("DataGridTags_MissingDataGridModel"));
int gridRenderState = dgm.getRenderState();
if(gridRenderState == DataGridTagModel.RENDER_STATE_HEADER) {
InternalStringBuilder content = new InternalStringBuilder();
AbstractRenderAppender appender = new StringBuilderRenderAppender(content);
StyleModel styleModel = dgm.getStyleModel();
assert styleModel != null;
TableRenderer tableRenderer = dgm.getTableRenderer();
assert tableRenderer != null;
if(dgm.isRenderRowGroups()) {
_theadTag.styleClass = (_theadTag.styleClass != null ? _theadTag.styleClass : styleModel.getTableHeadClass());
tableRenderer.openTableHead(_theadTag, appender);
}
TrTag.State trState = null;
if(_renderRow) {
trState = new TrTag.State();
trState.styleClass = styleModel.getHeaderRowClass();
tableRenderer.openHeaderRow(trState, appender);
}
JspFragment fragment = getJspBody();
if(fragment != null) {
StringWriter sw = new StringWriter();
fragment.invoke(sw);
appender.append(sw.toString());
}
if(_renderRow)
tableRenderer.closeHeaderRow(appender);
if(dgm.isRenderRowGroups()) {
tableRenderer.closeTableHead(appender);
String tfootScript = null;
if(_theadTag.id != null) {
HttpServletRequest request = JspUtil.getRequest(getJspContext());
tfootScript = renderNameAndId(request, _theadTag, null);