myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r1154078 - in /myfaces/core/branches/1.2.x/api/src/main/java/javax/faces/model: ArrayDataModel.java ListDataModel.java ResultDataModel.java ScalarDataModel.java
Date Fri, 05 Aug 2011 03:03:07 GMT
Author: lu4242
Date: Fri Aug  5 03:03:06 2011
New Revision: 1154078

URL: http://svn.apache.org/viewvc?rev=1154078&view=rev
Log:
MYFACES-3260 DataModel.setWrappedData should publish row change events even when it changes
from one instance to other one

Modified:
    myfaces/core/branches/1.2.x/api/src/main/java/javax/faces/model/ArrayDataModel.java
    myfaces/core/branches/1.2.x/api/src/main/java/javax/faces/model/ListDataModel.java
    myfaces/core/branches/1.2.x/api/src/main/java/javax/faces/model/ResultDataModel.java
    myfaces/core/branches/1.2.x/api/src/main/java/javax/faces/model/ScalarDataModel.java

Modified: myfaces/core/branches/1.2.x/api/src/main/java/javax/faces/model/ArrayDataModel.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/1.2.x/api/src/main/java/javax/faces/model/ArrayDataModel.java?rev=1154078&r1=1154077&r2=1154078&view=diff
==============================================================================
--- myfaces/core/branches/1.2.x/api/src/main/java/javax/faces/model/ArrayDataModel.java (original)
+++ myfaces/core/branches/1.2.x/api/src/main/java/javax/faces/model/ArrayDataModel.java Fri
Aug  5 03:03:06 2011
@@ -106,9 +106,17 @@ public class ArrayDataModel extends Data
 
     public void setWrappedData(Object data)
     {
-        _data = (Object[])data;
-        int rowIndex = _data != null ? 0 : -1;
-        setRowIndex(rowIndex);
+        if (data == null)
+        {
+            setRowIndex(-1);
+            _data = null;
+        }
+        else
+        {
+            _data = (Object[])data;
+            _rowIndex = -1;
+            setRowIndex(0);
+        }
     }
 
 }

Modified: myfaces/core/branches/1.2.x/api/src/main/java/javax/faces/model/ListDataModel.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/1.2.x/api/src/main/java/javax/faces/model/ListDataModel.java?rev=1154078&r1=1154077&r2=1154078&view=diff
==============================================================================
--- myfaces/core/branches/1.2.x/api/src/main/java/javax/faces/model/ListDataModel.java (original)
+++ myfaces/core/branches/1.2.x/api/src/main/java/javax/faces/model/ListDataModel.java Fri
Aug  5 03:03:06 2011
@@ -109,9 +109,17 @@ public class ListDataModel extends DataM
 
     public void setWrappedData(Object data)
     {
-        _data = (List)data;
-        int rowIndex = _data != null ? 0 : -1;
-        setRowIndex(rowIndex);
+        if (data == null)
+        {
+            setRowIndex(-1);
+            _data = null;
+        }
+        else
+        {
+            _data = (List)data;
+            _rowIndex = -1;
+            setRowIndex(0);
+        }
     }
 
 }

Modified: myfaces/core/branches/1.2.x/api/src/main/java/javax/faces/model/ResultDataModel.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/1.2.x/api/src/main/java/javax/faces/model/ResultDataModel.java?rev=1154078&r1=1154077&r2=1154078&view=diff
==============================================================================
--- myfaces/core/branches/1.2.x/api/src/main/java/javax/faces/model/ResultDataModel.java (original)
+++ myfaces/core/branches/1.2.x/api/src/main/java/javax/faces/model/ResultDataModel.java Fri
Aug  5 03:03:06 2011
@@ -122,10 +122,12 @@ public class ResultDataModel extends Dat
         if (data == null)
         {
             setRowIndex(-1);
+            _data = null;
         }
         else
         {
             _data = ((Result)data);
+            _rowIndex = -1;
             setRowIndex(0);
         }
     }

Modified: myfaces/core/branches/1.2.x/api/src/main/java/javax/faces/model/ScalarDataModel.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/1.2.x/api/src/main/java/javax/faces/model/ScalarDataModel.java?rev=1154078&r1=1154077&r2=1154078&view=diff
==============================================================================
--- myfaces/core/branches/1.2.x/api/src/main/java/javax/faces/model/ScalarDataModel.java (original)
+++ myfaces/core/branches/1.2.x/api/src/main/java/javax/faces/model/ScalarDataModel.java Fri
Aug  5 03:03:06 2011
@@ -101,9 +101,17 @@ public class ScalarDataModel extends Dat
     
     public void setWrappedData(Object data)
     {
-        _data = data;
-        int rowIndex = _data != null ? 0 : -1;
-        setRowIndex(rowIndex);
+        if (data == null)
+        {
+            setRowIndex(-1);
+            _data = null;
+        }
+        else
+        {
+            _data = data;
+            _rowIndex = -1;
+            setRowIndex(0);
+        }
     }
 
 }



Mime
View raw message