click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r963955 - /click/trunk/click/examples/src/org/apache/click/examples/page/table/EditFormTablePage.java
Date Wed, 14 Jul 2010 06:24:11 GMT
Author: sabob
Date: Wed Jul 14 06:24:11 2010
New Revision: 963955

URL: http://svn.apache.org/viewvc?rev=963955&view=rev
Log:
guard against empty customer list

Modified:
    click/trunk/click/examples/src/org/apache/click/examples/page/table/EditFormTablePage.java

Modified: click/trunk/click/examples/src/org/apache/click/examples/page/table/EditFormTablePage.java
URL: http://svn.apache.org/viewvc/click/trunk/click/examples/src/org/apache/click/examples/page/table/EditFormTablePage.java?rev=963955&r1=963954&r2=963955&view=diff
==============================================================================
--- click/trunk/click/examples/src/org/apache/click/examples/page/table/EditFormTablePage.java
(original)
+++ click/trunk/click/examples/src/org/apache/click/examples/page/table/EditFormTablePage.java
Wed Jul 14 06:24:11 2010
@@ -83,6 +83,7 @@ public class EditFormTablePage extends B
          * FormTable (table) so that paging and sorting will still work, even
          * if the Form was not submitted.
          */
+        @Override
         public boolean onProcess() {
             if (form.isFormSubmission()) {
                 return super.onProcess();
@@ -263,7 +264,9 @@ public class EditFormTablePage extends B
 
     private void refreshTableCustomers() {
         List<Customer> allCustomers = customerService.getCustomersSortedBy(Customer.DATE_JOINED_PROPERTY,
false);
-        List<Customer> customers = allCustomers.subList(0, NUM_ROWS);
-        table.setRowList(customers);
+        if (!allCustomers.isEmpty()) {
+            List<Customer> customers = allCustomers.subList(0, NUM_ROWS);
+            table.setRowList(customers);
+        }
     }
 }



Mime
View raw message