Author: jleroux
Date: Sun Oct 25 05:39:07 2015 New Revision: 1710413 URL: http://svn.apache.org/viewvc?rev=1710413&view=rev Log: A patch from Christian Carlow for "Paginator.getListLimits listSize gets set to viewSize for FindServices.performFindList" https://issues.apache.org/jira/browse/OFBIZ-6422 This patch adds code to Paginator to account for the entryList being instanceOf List and extracts from the context.results object the original listSize. jleroux, important note from OFBIZ-6423 which depends on OFBIZ-6422: it is necessary to assign a value (true makes sense) to override-list-size attribute so that FormRenderer.renderItemRows sets the lowIndex correctly, because once the results of performFindList are displayed, otherwise pages > 0 are rendered as empty. Modified: ofbiz/trunk/framework/common/servicedef/services.xml ofbiz/trunk/framework/widget/src/org/ofbiz/widget/renderer/Paginator.java Modified: ofbiz/trunk/framework/common/servicedef/services.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/servicedef/services.xml?rev=1710413&r1=1710412&r2=1710413&view=diff ============================================================================== --- ofbiz/trunk/framework/common/servicedef/services.xml (original) +++ ofbiz/trunk/framework/common/servicedef/services.xml Sun Oct 25 05:39:07 2015 @@ -248,7 +248,10 @@ under the License. <service name="performFindList" auth="false" engine="java" invoke="performFindList" location="org.ofbiz.common.FindServices"> <description>Generic service to return an partial list. set filterByDate to Y to exclude expired records. - set noConditionFind to Y to find without conditions. </description> + set noConditionFind to Y to find without conditions. + If used in a form, it is necessary to assign a value (true makes sense) to override-list-size attribute so that + FormRenderer.renderItemRows sets the lowIndex correctly, because once the results of performFindList are displayed, + otherwise pages > 0 are rendered as empty. see OFBIZ-6422 + 6423 for details <attribute name="entityName" type="String" mode="IN" optional="false"/> <attribute name="inputFields" type="java.util.Map" mode="IN" optional="false"/> <attribute name="orderBy" type="String" mode="IN" optional="true"/> Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/renderer/Paginator.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/renderer/Paginator.java?rev=1710413&r1=1710412&r2=1710413&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/renderer/Paginator.java (original) +++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/renderer/Paginator.java Sun Oct 25 05:39:07 2015 @@ -68,6 +68,12 @@ public final class Paginator { } else if (entryList instanceof List<?>) { List<?> items = (List<?>) entryList; listSize = items.size(); + if(context.containsKey("result")){ + Map<String, Object> resultMap = UtilGenerics.checkMap(context.get("result")); + if(resultMap.containsKey("listSize")){ + listSize = (int)resultMap.get("listSize"); + } + } } if (modelForm.getPaginate(context)) { viewIndex = getViewIndex(modelForm, context); |
Free forum by Nabble | Edit this page |