From 918eeb5c519971c18fc3f2015ab9f6587a5156c8 Mon Sep 17 00:00:00 2001
From: Emil Siverhall <emil-siv@dsv.su.se>
Date: Tue, 8 May 2012 11:01:10 +0200
Subject: [PATCH] changed iterator count to make pagination works properly

---
 .../su/dsv/scipro/datatables/CheckListTemplateDataPanel.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/main/java/se/su/dsv/scipro/datatables/CheckListTemplateDataPanel.java b/src/main/java/se/su/dsv/scipro/datatables/CheckListTemplateDataPanel.java
index fc389cafee..b40a403d4e 100644
--- a/src/main/java/se/su/dsv/scipro/datatables/CheckListTemplateDataPanel.java
+++ b/src/main/java/se/su/dsv/scipro/datatables/CheckListTemplateDataPanel.java
@@ -105,7 +105,10 @@ public class CheckListTemplateDataPanel extends Panel {
                 sort = new Sort(Sort.Direction.DESC, getSort().getProperty());
             }
 //            new Sort(Sort.Direction.ASC, getSort().toString())
-            return checklistTemplateService.find(filterString, new PageRequest(table.getCurrentPage(), count, sort)).iterator();
+            
+            //Changed from count to table.getRowsPerPage to make pagination work.
+            //return checklistTemplateService.find(filterString, new PageRequest(table.getCurrentPage(), count, sort)).iterator();
+            return checklistTemplateService.find(filterString, new PageRequest(table.getCurrentPage(), table.getRowsPerPage(), sort)).iterator();
         }
 
         @Override