myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r1154080 - in /myfaces/core/trunk/api/src/main/java/javax/faces/model: ArrayDataModel.java ListDataModel.java ResultDataModel.java ScalarDataModel.java
Date Fri, 05 Aug 2011 03:04:01 GMT
Author: lu4242
Date: Fri Aug  5 03:04:00 2011
New Revision: 1154080

URL: http://svn.apache.org/viewvc?rev=1154080&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/trunk/api/src/main/java/javax/faces/model/ArrayDataModel.java
    myfaces/core/trunk/api/src/main/java/javax/faces/model/ListDataModel.java
    myfaces/core/trunk/api/src/main/java/javax/faces/model/ResultDataModel.java
    myfaces/core/trunk/api/src/main/java/javax/faces/model/ScalarDataModel.java

Modified: myfaces/core/trunk/api/src/main/java/javax/faces/model/ArrayDataModel.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/java/javax/faces/model/ArrayDataModel.java?rev=1154080&r1=1154079&r2=1154080&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/java/javax/faces/model/ArrayDataModel.java (original)
+++ myfaces/core/trunk/api/src/main/java/javax/faces/model/ArrayDataModel.java Fri Aug  5
03:04:00 2011
@@ -110,9 +110,17 @@ public class ArrayDataModel<E> extends D
     @Override
     public void setWrappedData(Object data)
     {
-        _data = (E[])data;
-        int rowIndex = _data != null ? 0 : -1;
-        setRowIndex(rowIndex);
+        if (data == null)
+        {
+            setRowIndex(-1);
+            _data = null;
+        }
+        else
+        {
+            _data = (E[])data;
+            _rowIndex = -1;
+            setRowIndex(0);
+        }
     }
 
 }

Modified: myfaces/core/trunk/api/src/main/java/javax/faces/model/ListDataModel.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/java/javax/faces/model/ListDataModel.java?rev=1154080&r1=1154079&r2=1154080&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/java/javax/faces/model/ListDataModel.java (original)
+++ myfaces/core/trunk/api/src/main/java/javax/faces/model/ListDataModel.java Fri Aug  5 03:04:00
2011
@@ -113,9 +113,17 @@ public class ListDataModel<E> extends Da
     @Override
     public void setWrappedData(Object data)
     {
-        _data = (List<E>)data;
-        int rowIndex = _data != null ? 0 : -1;
-        setRowIndex(rowIndex);
+        if (data == null)
+        {
+            setRowIndex(-1);
+            _data = null;
+        }
+        else
+        {
+            _data = (List<E>)data;
+            _rowIndex = -1;
+            setRowIndex(0);
+        }
     }
 
 }

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

Modified: myfaces/core/trunk/api/src/main/java/javax/faces/model/ScalarDataModel.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/java/javax/faces/model/ScalarDataModel.java?rev=1154080&r1=1154079&r2=1154080&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/java/javax/faces/model/ScalarDataModel.java (original)
+++ myfaces/core/trunk/api/src/main/java/javax/faces/model/ScalarDataModel.java Fri Aug  5
03:04:00 2011
@@ -104,9 +104,17 @@ public class ScalarDataModel<E> extends 
     @Override
     public void setWrappedData(Object data)
     {
-        _data = (E) data;
-        int rowIndex = _data != null ? 0 : -1;
-        setRowIndex(rowIndex);
+        if (data == null)
+        {
+            setRowIndex(-1);
+            _data = null;
+        }
+        else
+        {
+            _data = (E) data;
+            _rowIndex = -1;
+            setRowIndex(0);
+        }
     }
 
 }



Mime
View raw message