ScrollableDataTableRendererState state = ScrollableDataTableRendererState.createState(context, grid);
AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
String client_id = grid.getClientId(context);
state.setClientId(client_id);
state.setAjaxContext(ajaxContext);
state.setRowIndex(ScrollableDataTableUtils.getClientRowIndex(grid));
if (log.isDebugEnabled()) {
log.debug("ScrollableDataTableBaseRenderer.renderAjaxChildren()");
}
grid.getResponseData().clear();
ResponseWriter writer = context.getResponseWriter();
writer.startElement("table", grid);
writer.startElement("tbody", grid);
grid.walk(context, ajaxRowsRenderer, state);
int fakeRowsCount = grid.getRows() - grid.getRowCount();
ScrollableDataTableRendererState.restoreState(context);
grid.setRowKey(null);
state.setFake(true);
for (int i = 0; i < fakeRowsCount; i++) {
ajaxRowsRenderer.process(context, null, state);
}
state.setFake(false);
writer.endElement("tbody");
writer.endElement("table");
String id = client_id+"_rows_input";
writer.startElement(HTML.INPUT_ELEM, grid);
writer.writeAttribute(HTML.TYPE_ATTR, "hidden", null);
writer.writeAttribute(HTML.id_ATTRIBUTE, id, null);
writer.writeAttribute(HTML.NAME_ATTRIBUTE, id, null);
writer.writeAttribute(HTML.value_ATTRIBUTE, grid.getRowCount(), null);
writer.endElement(HTML.INPUT_ELEM);
ajaxContext.addRenderedArea(id);
renderHiddenScrollInput(context, grid);
ajaxContext.addRenderedArea(client_id+":si");
ajaxContext.setResponseData(grid.getResponseData());
ajaxContext.getAjaxRenderedAreas().remove(grid.getClientId(context));
ScrollableDataTableScrollData options = createOptions(grid);
ajaxContext.getResponseDataMap().put("options", options);
//Then call contributors to write additional HTML content
contributorsEncodeHere(context, grid);
if (shouldUpdateHeader(component)) {