click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r929482 - /click/trunk/click/framework/src/org/apache/click/control/Table.java
Date Wed, 31 Mar 2010 11:38:16 GMT
Author: sabob
Date: Wed Mar 31 11:38:16 2010
New Revision: 929482

URL: http://svn.apache.org/viewvc?rev=929482&view=rev
Log:
clear rowList when setting dataProvider

Modified:
    click/trunk/click/framework/src/org/apache/click/control/Table.java

Modified: click/trunk/click/framework/src/org/apache/click/control/Table.java
URL: http://svn.apache.org/viewvc/click/trunk/click/framework/src/org/apache/click/control/Table.java?rev=929482&r1=929481&r2=929482&view=diff
==============================================================================
--- click/trunk/click/framework/src/org/apache/click/control/Table.java (original)
+++ click/trunk/click/framework/src/org/apache/click/control/Table.java Wed Mar 31 11:38:16
2010
@@ -760,12 +760,18 @@ public class Table extends AbstractContr
 
     /**
      * Set the table row list DataProvider.
+     * <p/>
+     * <b>Please note</b>: setting the dataProvider will nullify the table
+     * {@link #setRowList(java.util.List) rowList}.
      *
      * @param dataProvider the table row list DataProvider
      */
     @SuppressWarnings("unchecked")
     public void setDataProvider(DataProvider dataProvider) {
         this.dataProvider = dataProvider;
+        if (dataProvider != null) {
+            setRowList(null);
+        }
     }
 
     /**
@@ -1453,7 +1459,7 @@ public class Table extends AbstractContr
                 setSorted(true);
             }
 
-            Iterable iterableData = dataProvider.getData();
+            Iterable iterableData = dp.getData();
 
             // If dataProvider returns a list, use that as the rowList
             if (iterableData instanceof List) {



Mime
View raw message