You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@click.apache.org by sa...@apache.org on 2010/07/14 08:24:11 UTC
svn commit: r963955 -
/click/trunk/click/examples/src/org/apache/click/examples/page/table/EditFormTablePage.java
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);
+ }
}
}