Changed the pagination handling in the findParty service to be consistent with the form widget's pagination.
Based on suggestion from Illya Kysil (OFBIZ-371). git-svn-id: https://svn.apache.org/repos/asf/incubator/ofbiz/trunk@478807 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -990,11 +990,11 @@ public class PartyServices {
|
||||
}
|
||||
|
||||
// set the page parameters
|
||||
int viewIndex = 1;
|
||||
int viewIndex = 0;
|
||||
try {
|
||||
viewIndex = Integer.parseInt((String) context.get("VIEW_INDEX"));
|
||||
} catch (Exception e) {
|
||||
viewIndex = 1;
|
||||
viewIndex = 0;
|
||||
}
|
||||
result.put("viewIndex", new Integer(viewIndex));
|
||||
|
||||
@@ -1285,8 +1285,8 @@ public class PartyServices {
|
||||
EntityListIterator pli = delegator.findListIteratorByCondition(dynamicView, mainCond, null, fieldsToSelect, orderBy, findOpts);
|
||||
|
||||
// get the indexes for the partial list
|
||||
lowIndex = (((viewIndex - 1) * viewSize) + 1);
|
||||
highIndex = viewIndex * viewSize;
|
||||
lowIndex = viewIndex * viewSize + 1;
|
||||
highIndex = (viewIndex + 1) * viewSize;
|
||||
|
||||
// get the partial list for this page
|
||||
partyList = pli.getPartialList(lowIndex, viewSize);
|
||||
@@ -1297,7 +1297,7 @@ public class PartyServices {
|
||||
if (highIndex > partyListSize) {
|
||||
highIndex = partyListSize;
|
||||
}
|
||||
|
||||
|
||||
// close the list iterator
|
||||
pli.close();
|
||||
} catch (GenericEntityException e) {
|
||||
|
||||
@@ -208,14 +208,12 @@ function refreshInfo() {
|
||||
<td width="50%">
|
||||
<div class="boxhead" align="right">
|
||||
<#if (partyListSize > 0)>
|
||||
<#if (viewIndex > 1)>
|
||||
<#if (viewIndex > 0)>
|
||||
<a href="<@ofbizUrl>findparty?VIEW_SIZE=${viewSize}&VIEW_INDEX=${viewIndex-1}&hideFields=${parameters.hideFields?default("N")}${paramList}</@ofbizUrl>" class="submenutext">${uiLabelMap.CommonPrevious}</a>
|
||||
<#else>
|
||||
<span class="submenutextdisabled">${uiLabelMap.CommonPrevious}</span>
|
||||
</#if>
|
||||
<#if (partyListSize > 0)>
|
||||
<span class="submenutextinfo">${lowIndex} - ${highIndex} ${uiLabelMap.CommonOf} ${partyListSize}</span>
|
||||
</#if>
|
||||
<span class="submenutextinfo">${lowIndex} - ${highIndex} ${uiLabelMap.CommonOf} ${partyListSize}</span>
|
||||
<#if (partyListSize > highIndex)>
|
||||
<a href="<@ofbizUrl>findparty?VIEW_SIZE=${viewSize}&VIEW_INDEX=${viewIndex+1}&hideFields=${parameters.hideFields?default("N")}${paramList}</@ofbizUrl>" class="submenutextright">${uiLabelMap.CommonNext}</a>
|
||||
<#else>
|
||||
|
||||
Reference in New Issue
Block a user