Author: pkawiak
Date: 2008-08-04 03:34:47 -0400 (Mon, 04 Aug 2008)
New Revision: 9872
Modified:
trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedRowsRenderer.java
trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java
trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/ExtendedTableHolder.java
Log:
moving firstRow to holder
Modified:
trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedRowsRenderer.java
===================================================================
---
trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedRowsRenderer.java 2008-08-03
21:50:24 UTC (rev 9871)
+++
trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedRowsRenderer.java 2008-08-04
07:34:47 UTC (rev 9872)
@@ -47,10 +47,6 @@
HeaderResourcesRendererBase implements DataVisitor {
protected static final String MENU_ID = "_TABLE_MENU_ID_";
-
- //TODO nick - renderer classes are singletons by nature, they should not have
- // non-static/non-final fields
- protected boolean firstRow = true;
protected class CompositeRendererEnabler extends CompositeRenderer {
public CompositeRendererEnabler() {
@@ -157,7 +153,7 @@
*/
protected void encodeRows(FacesContext context, UIComponent component,
ExtendedTableHolder tableHolder) throws IOException {
- this.firstRow = true;
+ tableHolder.setFirstRow(true);
UIDataAdaptor table = (UIDataAdaptor) component;
Object key = table.getRowKey();
table.captureOrigValue(context);
Modified:
trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java
===================================================================
---
trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java 2008-08-03
21:50:24 UTC (rev 9871)
+++
trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/AbstractExtendedTableRenderer.java 2008-08-04
07:34:47 UTC (rev 9872)
@@ -591,12 +591,12 @@
int currentColumn = 0;
UIColumn column = null;
if (holder.isGroupingOn() && (rowGroupChanged(context, holder))) {
- if (this.firstRow) {
+ if (holder.isFirstRow()) {
encodeFakeIeRow(context, table, holder);
}
encodeGroupRow(context, table, holder);
}
- this.firstRow = false;
+ holder.setFirstRow(false);
while (iter.hasNext()) {
column = iter.next();
// Start new row for first column - expect a case of the detail
Modified:
trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/ExtendedTableHolder.java
===================================================================
---
trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/ExtendedTableHolder.java 2008-08-03
21:50:24 UTC (rev 9871)
+++
trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/ExtendedTableHolder.java 2008-08-04
07:34:47 UTC (rev 9872)
@@ -20,6 +20,7 @@
private int groupRowCounter = -1;
private boolean groupingOn = false;
+ private boolean firstRow = true;
private UIColumn groupingColumn = null;
private String groupingColumnLabel = null;
@@ -42,7 +43,17 @@
}
}
- public UIExtendedDataTable getTable() {
+ public boolean isFirstRow() {
+ return firstRow;
+ }
+
+ public void setFirstRow(boolean firstRow) {
+ this.firstRow = firstRow;
+ }
+
+
+
+ public UIExtendedDataTable getTable() {
return (UIExtendedDataTable)super.getTable();
}