From b0fbeea21a43d100e462d173fafc99531d18a819 Mon Sep 17 00:00:00 2001 From: Kevin Roast Date: Fri, 20 Jul 2007 11:13:48 +0000 Subject: [PATCH] Fix for AWC-1436 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6307 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../web/ui/common/component/data/UIRichList.java | 11 +++++++++-- source/web/jsp/workflow/pooled-tasks-todo-dashlet.jsp | 4 ++-- source/web/jsp/workflow/tasks-active-dashlet.jsp | 4 ++-- source/web/jsp/workflow/tasks-completed-dashlet.jsp | 4 ++-- source/web/jsp/workflow/tasks-todo-dashlet.jsp | 4 ++-- 5 files changed, 17 insertions(+), 10 deletions(-) diff --git a/source/java/org/alfresco/web/ui/common/component/data/UIRichList.java b/source/java/org/alfresco/web/ui/common/component/data/UIRichList.java index 95d92cad36..2f1a3845ff 100644 --- a/source/java/org/alfresco/web/ui/common/component/data/UIRichList.java +++ b/source/java/org/alfresco/web/ui/common/component/data/UIRichList.java @@ -351,6 +351,7 @@ public class UIRichList extends UIComponentBase implements IDataContainer public void setCurrentPage(int index) { this.currentPage = index; + this.sortOrPageChanged = true; } /** @@ -405,13 +406,14 @@ public class UIRichList extends UIComponentBase implements IDataContainer { this.sortColumn = column; this.sortDescending = descending; + this.sortOrPageChanged = true; // delegate to the data model to sort its contents // place in a UserTransaction as we may need to perform a LOT of node calls to complete UserTransaction tx = null; try { - if (getDataModel().size() > 64) + if (getDataModel().size() > 16) { FacesContext context = FacesContext.getCurrentInstance(); tx = Repository.getUserTransaction(context, true); @@ -537,7 +539,11 @@ public class UIRichList extends UIComponentBase implements IDataContainer } // reset current page - this.currentPage = 0; + if (this.sortOrPageChanged == false) + { + this.currentPage = 0; + } + this.sortOrPageChanged = false; } return this.dataModel; @@ -566,6 +572,7 @@ public class UIRichList extends UIComponentBase implements IDataContainer private int rowIndex = -1; private int maxRowIndex = -1; private int pageCount = 1; + private boolean sortOrPageChanged = false; private static Log logger = LogFactory.getLog(IDataContainer.class); } diff --git a/source/web/jsp/workflow/pooled-tasks-todo-dashlet.jsp b/source/web/jsp/workflow/pooled-tasks-todo-dashlet.jsp index 5ab17bd0aa..901947c14d 100644 --- a/source/web/jsp/workflow/pooled-tasks-todo-dashlet.jsp +++ b/source/web/jsp/workflow/pooled-tasks-todo-dashlet.jsp @@ -14,7 +14,7 @@ <%-- Primary column for details view mode --%> - + - + \ No newline at end of file diff --git a/source/web/jsp/workflow/tasks-active-dashlet.jsp b/source/web/jsp/workflow/tasks-active-dashlet.jsp index 7d4c789f13..191e475528 100644 --- a/source/web/jsp/workflow/tasks-active-dashlet.jsp +++ b/source/web/jsp/workflow/tasks-active-dashlet.jsp @@ -14,7 +14,7 @@ <%-- Primary column for details view mode --%> - + - + \ No newline at end of file diff --git a/source/web/jsp/workflow/tasks-completed-dashlet.jsp b/source/web/jsp/workflow/tasks-completed-dashlet.jsp index 2223db2128..80556a8d32 100644 --- a/source/web/jsp/workflow/tasks-completed-dashlet.jsp +++ b/source/web/jsp/workflow/tasks-completed-dashlet.jsp @@ -14,7 +14,7 @@ <%-- Primary column for details view mode --%> - + - + \ No newline at end of file diff --git a/source/web/jsp/workflow/tasks-todo-dashlet.jsp b/source/web/jsp/workflow/tasks-todo-dashlet.jsp index 82add93d6d..eb99d1728b 100644 --- a/source/web/jsp/workflow/tasks-todo-dashlet.jsp +++ b/source/web/jsp/workflow/tasks-todo-dashlet.jsp @@ -14,7 +14,7 @@ <%-- Primary column for details view mode --%> - + - + \ No newline at end of file