Author: abelevich
Date: 2007-11-01 13:13:25 -0400 (Thu, 01 Nov 2007)
New Revision: 3682
Modified:
branches/3.1.x/ui/dataTable/src/main/config/component/dataGrid.xml
branches/3.1.x/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractGridRenderer.java
Log:
fix doCleanup method RF-1274
Modified: branches/3.1.x/ui/dataTable/src/main/config/component/dataGrid.xml
===================================================================
--- branches/3.1.x/ui/dataTable/src/main/config/component/dataGrid.xml 2007-11-01 17:13:00
UTC (rev 3681)
+++ branches/3.1.x/ui/dataTable/src/main/config/component/dataGrid.xml 2007-11-01 17:13:25
UTC (rev 3682)
@@ -49,6 +49,7 @@
<property>
<name>columns</name>
<classname>int</classname>
+ <defaultvalue>0</defaultvalue>
<description>Quantity of columns
</description>
</property>
Modified:
branches/3.1.x/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractGridRenderer.java
===================================================================
---
branches/3.1.x/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractGridRenderer.java 2007-11-01
17:13:00 UTC (rev 3681)
+++
branches/3.1.x/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractGridRenderer.java 2007-11-01
17:13:25 UTC (rev 3682)
@@ -75,13 +75,15 @@
int gridRowCounter = holder.getGridRowCounter();
if ( cols >0 && currentRow%cols==0) {
if (currentRow != 0 ) {
- writer.endElement(HTML.TR_ELEMENT);
- holder.setGridRowCounter(++gridRowCounter);
+ writer.endElement(HTML.TR_ELEMENT);
+ holder.setGridRowCounter(++gridRowCounter);
}
+
writer.startElement(HTML.TR_ELEMENT, table);
String rowClass = holder.getRowClass(gridRowCounter);
encodeStyleClass(writer, null, "dr-table-row rich-table-row", null,
rowClass);
encodeRowEvents(context, table);
+
}
writer.startElement(HTML.td_ELEM, table);
getUtils().encodeId(context, table);
@@ -98,8 +100,12 @@
UIDataAdaptor table = tableHolder.getTable();
ResponseWriter writer = context.getResponseWriter();
Integer columns = (Integer) table.getAttributes().get("columns");
+
if (null!=columns && columns.intValue()!=Integer.MIN_VALUE ) {
int rest =
tableHolder.getRowCounter()-tableHolder.getGridRowCounter()*columns.intValue();
+ if(rest == 0){
+ writer.startElement(HTML.TR_ELEMENT, table);
+ }
for(int i = rest;i<columns.intValue();i++){
writer.startElement(HTML.td_ELEM, table);
String columnClass = tableHolder.getColumnClass(i);