String rcls = dataListComponent.getRowStyleClass(facesContext); String rowClasses[] = parseClasses(rcls);      String tdClass = getStyleClassName(componentRenderContext, dataListComponent) + "_cell";  int count = listContext.getRowCount();  Map varContext = facesContext.getExternalContext().getRequestMap(); String rowCountVar = listContext.getRowCountVar(); if (rowCountVar != null) { varContext.put(rowCountVar, new Integer(count)); }  String rowIndexVar = listContext.getRowIndexVar();  IHtmlRenderContext htmlRenderContext = (IHtmlRenderContext) htmlWriter .getComponentRenderContext().getRenderContext();  try { int processed = 0;  for (; rows <= 0 || processed < rows; processed++, rowIndex++) {  dataListComponent.setRowIndex(rowIndex); if (dataListComponent.isRowAvailable() == false) { break; }  if (rowIndexVar != null) { varContext.put(rowIndexVar, new Integer(processed)); }  if ((processed % columnNumber) == 0) {  htmlWriter.startElement("TR");  String rowId = htmlRenderContext.getComponentId( facesContext, dataListComponent); if (rowId != null) { htmlWriter.writeAttribute("id", rowId); }  htmlWriter.writeAttribute("v:nc", "true");  if (rowClasses.length > 0) { int rs = (processed / columnNumber) % rowClasses.length;  htmlWriter.writeAttribute("class", rowClasses[rs]); } }  htmlWriter.startElement("TD"); htmlWriter.writeAttribute("class", tdClass);  htmlWriter.writeln();    htmlWriter.flush();  UIColumn column = columns[processed % columns.length];  ComponentTools.encodeChildrenRecursive(facesContext, column);  htmlWriter.writeln();  htmlWriter.endElement("TD");  if (((processed + 1) % columnNumber) == 0) { htmlWriter.endElement("TR"); } }  if ((processed % columnNumber) > 0) { for (; (processed % columnNumber) > 0; processed++) { htmlWriter.startElement("TD"); htmlWriter.endElement("TD"); }  htmlWriter.endElement("TR"); }  } finally { dataListComponent.setRowIndex(-1); }
encodeChildren(htmlWriter, listContext);
    public void encodeChildren(IComponentWriter writer, ListContext listContext)            throws WriterException {        FacesContext facesContext = writer.getComponentRenderContext()                .getFacesContext();        IComponentRenderContext componentRenderContext = writer                .getComponentRenderContext();        DataListComponent dataListComponent = (DataListComponent) componentRenderContext                .getComponent();        IHtmlWriter htmlWriter = (IHtmlWriter) writer;        boolean filtered = false;        /*         * DataModel dataModel = listContext.getDataModel();         *          * IFilterProperties filtersMap = listContext.getFiltersMap(); if         * (filtersMap != null) { if (dataModel instanceof IFiltredDataModel) {         * IFiltredDataModel filtredDataModel = (IFiltredDataModel) dataModel;         *          * filtredDataModel.setFilter(filtersMap); listContext.updateRowCount();         *          * filtred = true; } else { dataModel =         * FiltredDataModel.filter(dataModel, filtersMap);         * listContext.updateRowCount(); } } else if (dataModel instanceof         * IFiltredDataModel) { IFiltredDataModel filtredDataModel =         * (IFiltredDataModel) dataModel;         *          * filtredDataModel.setFilter(FilterExpressionTools.EMPTY);         * listContext.updateRowCount();         *          * filtred = true; }         */        UIColumn columns[] = listContext.listColumns();        // Debut        int rowIndex = listContext.getFirst();        // Nombre de ligne a lire !        int rows = listContext.getRows();        int columnNumber = listContext.getColumnNumber();        if (columnNumber > 1) {            rows = rows * columnNumber;        }        String rcls = dataListComponent.getRowStyleClass(facesContext);        String rowClasses[] = parseClasses(rcls);        // String ccls =        // dataListComponent.getColumnStyleClass(facesContext);        // String columnClasses[] = parseClasses(ccls);        String tdClass = getStyleClassName(componentRenderContext,                dataListComponent)                + "_cell";        int count = listContext.getRowCount();        Map varContext = facesContext.getExternalContext().getRequestMap();        String rowCountVar = listContext.getRowCountVar();        if (rowCountVar != null) {            varContext.put(rowCountVar, new Integer(count));        }        String rowIndexVar = listContext.getRowIndexVar();        IHtmlRenderContext htmlRenderContext = (IHtmlRenderContext) htmlWriter                .getComponentRenderContext().getRenderContext();        try {            int processed = 0;            for (; rows <= 0 || processed < rows; processed++, rowIndex++) {                dataListComponent.setRowIndex(rowIndex);                if (dataListComponent.isRowAvailable() == false) {                    break;                }                if (rowIndexVar != null) {                    varContext.put(rowIndexVar, new Integer(processed));                }                if ((processed % columnNumber) == 0) {                    // Render the beginning of this row                    htmlWriter.startElement("TR");                    String rowId = htmlRenderContext.getComponentId(                            facesContext, dataListComponent);                    if (rowId != null) {                        htmlWriter.writeAttribute("id", rowId);                    }                    htmlWriter.writeAttribute("v:nc", "true");                    if (rowClasses.length > 0) {                        int rs = (processed / columnNumber) % rowClasses.length;                        htmlWriter.writeAttribute("class", rowClasses[rs]);                    }                }                htmlWriter.startElement("TD");                htmlWriter.writeAttribute("class", tdClass);                htmlWriter.writeln();                /*                 * if (columnClasses.length > 0) { int rs = (processed %                 * columnNumber) % columnClasses.length;                 *                  * htmlWriter.writeAttribute("class", columnClasses[rs]); }                 */                htmlWriter.flush();                UIColumn column = columns[processed % columns.length];                ComponentTools.encodeChildrenRecursive(facesContext, column);                htmlWriter.writeln();                htmlWriter.endElement("TD");                if (((processed + 1) % columnNumber) == 0) {                    htmlWriter.endElement("TR");                }            }            if ((processed % columnNumber) > 0) {                for (; (processed % columnNumber) > 0; processed++) {                    htmlWriter.startElement("TD");                    htmlWriter.endElement("TD");                }                htmlWriter.endElement("TR");            }        } finally {            dataListComponent.setRowIndex(-1);        }    }