Author: nbelaevski
Date: 2010-12-01 11:47:10 -0500 (Wed, 01 Dec 2010)
New Revision: 20269
Modified:
trunk/ui/common/ui/src/main/java/org/richfaces/component/UIDataAdaptor.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeEncoderBase.java
Log:
Revert "https://jira.jboss.org/browse/RF-9680"
This reverts commit 91df734486336d26683612eaa91c59b8062aec32.
Modified: trunk/ui/common/ui/src/main/java/org/richfaces/component/UIDataAdaptor.java
===================================================================
--- trunk/ui/common/ui/src/main/java/org/richfaces/component/UIDataAdaptor.java 2010-12-01
16:44:18 UTC (rev 20268)
+++ trunk/ui/common/ui/src/main/java/org/richfaces/component/UIDataAdaptor.java 2010-12-01
16:47:10 UTC (rev 20269)
@@ -246,6 +246,10 @@
private Object rowKey = null;
+ private boolean rowDataIsSet = false;
+
+ private Object rowData;
+
private String clientId;
private Object originalVarValue;
@@ -367,6 +371,34 @@
return rowKey;
}
+ private void setRowKeyAndData(FacesContext facesContext, Object rowKey, boolean
localRowDataAvailable, Object localRowData) {
+ this.saveChildState(facesContext);
+
+ this.rowKey = rowKey;
+
+ if (localRowDataAvailable) {
+ this.rowData = localRowData;
+ this.rowDataIsSet = (rowKey != null);
+ } else {
+ this.rowData = null;
+ this.rowDataIsSet = false;
+
+ getExtendedDataModel().setRowKey(rowKey);
+ }
+
+ this.clientId = null;
+
+ boolean rowSelected = (rowKey != null) && isRowAvailable();
+
+ setupVariable(facesContext, rowSelected);
+
+ this.restoreChildState(facesContext);
+ }
+
+ protected void setRowKeyAndData(FacesContext facesContext, Object rowKey, Object
localRowData) {
+ setRowKeyAndData(facesContext, rowKey, true, localRowData);
+ }
+
/**
* Setup current row by key. Perform same functionality as
* {@link javax.faces.component.UIData#setRowIndex(int)}, but for key object - it may
be not only
@@ -615,11 +647,15 @@
}
public Object getRowData() {
+ if (rowDataIsSet) {
+ return rowData;
+ }
+
return getExtendedDataModel().getRowData();
}
public boolean isRowAvailable() {
- return getExtendedDataModel().isRowAvailable();
+ return rowDataIsSet || getExtendedDataModel().isRowAvailable();
}
/**
Modified:
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeEncoderBase.java
===================================================================
---
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeEncoderBase.java 2010-12-01
16:44:18 UTC (rev 20268)
+++
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeEncoderBase.java 2010-12-01
16:47:10 UTC (rev 20269)
@@ -162,7 +162,8 @@
writeTreeNodeEndElement();
} catch (IOException e) {
- throw new FacesException(e.getMessage(), e);
+ // TODO Auto-generated catch block
+ e.printStackTrace();
}
}
Show replies by date