responseWriter.endElement("grid");
}
public void encodeChildren(FacesContext facesContext, UIComponent component) throws IOException {
GridComponent gridComponent = (GridComponent) component;
ResponseWriter responseWriter = facesContext.getResponseWriter();
responseWriter.startElement("columns", component);
List<UIComponent> children = gridComponent.getChildren();
for (UIComponent kid : children) {
renderChild(facesContext, kid);
}
responseWriter.endElement("columns");
Object value = gridComponent.getValue();
if (value != null) {
responseWriter.startElement("rows", component);
String rowsId = gridComponent.getClientId(facesContext)+"_rows";
responseWriter.writeAttribute("id",rowsId,"id");
if (value instanceof Collection) {
int first = gridComponent.getFirst();
int rows = gridComponent.getRows();
int rowCount = gridComponent.getRowCount();
if (rows <= 0) {
rows = rowCount - first;
}
int last = first + rows;
if (last > rowCount) last = rowCount;
for (int i = first; i < last; i++) {
gridComponent.setRowIndex(i);
if (!gridComponent.isRowAvailable()) {
return;
}
Object object = gridComponent.getRowData();
responseWriter.startElement("row", component);
encodeRow(facesContext, gridComponent, object);
responseWriter.endElement("row");
}
}