Author: alexsmirnov
Date: 2008-05-13 20:33:20 -0400 (Tue, 13 May 2008)
New Revision: 8566
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
Log:
fix
http://jira.jboss.com/jira/browse/RF-3410
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java
===================================================================
---
trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java 2008-05-13
22:43:48 UTC (rev 8565)
+++
trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java 2008-05-14
00:33:20 UTC (rev 8566)
@@ -98,7 +98,13 @@
Iterator<UIComponent> childIterator = dataChildren();
while (childIterator.hasNext()) {
UIComponent component = childIterator.next();
- processComponent(context, component, argument);
+ if (UIColumn.class.equals(component.getClass())) {
+ for (UIComponent children : component.getChildren()) {
+ processComponent(context, children, argument);
+ }
+ } else {
+ processComponent(context, component, argument);
+ }
}
}
@@ -272,14 +278,11 @@
boolean rowAvailable = isRowAvailable();
- // if(key == localModel.getRowIndex()){
- // return;
- // }
- if (rowAvailable) {
+// if (rowAvailable) {
// save child state
this.saveChildState(faces);
- }
+// }
// Set current model row by int, but immediately get value from model.
// for compability, complex models must provide values map between
@@ -294,10 +297,10 @@
setupVariable(faces, localModel, rowSelected);
- if (rowAvailable) {
+// if (rowAvailable ) {
// restore child state
this.restoreChildState(faces);
- }
+// }
}
/*
@@ -338,10 +341,10 @@
boolean rowAvailable = isRowAvailable();
- if (rowAvailable) {
+// if (rowAvailable) {
// save child state
this.saveChildState(faces);
- }
+// }
this._rowKey = key;
this._clientId = null;
@@ -354,10 +357,10 @@
//XXX check for row availability
setupVariable(faces, localModel, rowSelected);
- if (rowAvailable) {
+// if (rowAvailable ) {
// restore child state
this.restoreChildState(faces);
- }
+// }
}
/**
@@ -885,8 +888,8 @@
protected void saveChildState(FacesContext faces) {
Iterator<UIComponent> itr = dataChildren();
+ Map<String, SavedState> childState = this.getChildState(faces);
while (itr.hasNext()) {
- Map<String, SavedState> childState = this.getChildState(faces);
this.saveChildState(faces, (UIComponent) itr.next(), childState);
}
}
@@ -936,8 +939,8 @@
protected void restoreChildState(FacesContext faces) {
Iterator<UIComponent> itr = dataChildren();
+ Map<String, SavedState> childState = this.getChildState(faces);
while (itr.hasNext()) {
- Map<String, SavedState> childState = this.getChildState(faces);
this.restoreChildState(faces, (UIComponent) itr.next(), childState);
}
}
Modified:
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
===================================================================
---
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2008-05-13
22:43:48 UTC (rev 8565)
+++
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2008-05-14
00:33:20 UTC (rev 8566)
@@ -68,6 +68,9 @@
public void encodeTableStructure(FacesContext context, UIDataTable table)
throws IOException {
ResponseWriter writer = context.getResponseWriter();
+ Object key = table.getRowKey();
+ table.captureOrigValue(context);
+ table.setRowKey(context, null);
int columns = getColumnsCount(table);
// Encode colgroup definition.
writer.startElement("colgroup", table);
@@ -88,6 +91,8 @@
encodeCaption(context, table);
encodeHeader(context, table, columns);
encodeFooter(context, table, columns);
+ table.setRowKey(context,key);
+ table.restoreOrigValue(context);
}
public void encodeHeader(FacesContext context, UIDataTable table,