You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by gc...@apache.org on 2012/02/02 02:19:46 UTC

svn commit: r1239428 - /myfaces/trinidad/branches/1.2.12.6.2-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/CollectionModel.java

Author: gcrawford
Date: Thu Feb  2 01:19:46 2012
New Revision: 1239428

URL: http://svn.apache.org/viewvc?rev=1239428&view=rev
Log:
TRINIDAD-2210  

thanks to Yuan.

Modified:
    myfaces/trinidad/branches/1.2.12.6.2-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/CollectionModel.java

Modified: myfaces/trinidad/branches/1.2.12.6.2-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/CollectionModel.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.12.6.2-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/CollectionModel.java?rev=1239428&r1=1239427&r2=1239428&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.12.6.2-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/CollectionModel.java (original)
+++ myfaces/trinidad/branches/1.2.12.6.2-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/CollectionModel.java Thu Feb  2 01:19:46 2012
@@ -118,6 +118,28 @@ public abstract class CollectionModel ex
   }
 
   /**
+   * Returns the rowData for the given rowKey without changing model currency.  
+   * Implementations may choose to implement this behavior by saving and restoring the currency.
+   * 
+   * @see CollectionModel#getRowData()
+   * @param rowKey the row key of the row to get data from.
+   * @return the data for the given row. 
+   */
+  public Object getRowData(Object rowKey)
+  {
+    Object oldKey = getRowKey();
+    try
+    {
+      setRowKey(rowKey);
+      return getRowData();
+    }
+    finally
+    {
+      setRowKey(oldKey);
+    }
+  }
+
+  /**
    * Return true if this collection is sortable by the given property.
    * This implementation always returns false;
    */