svn commit: r478807 - in /incubator/ofbiz/trunk/applications/party: src/org/ofbiz/party/party/PartyServices.java webapp/partymgr/party/findparty.ftl

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r478807 - in /incubator/ofbiz/trunk/applications/party: src/org/ofbiz/party/party/PartyServices.java webapp/partymgr/party/findparty.ftl

jacopoc
Author: jacopoc
Date: Fri Nov 24 00:55:00 2006
New Revision: 478807

URL: http://svn.apache.org/viewvc?view=rev&rev=478807
Log:
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).

Modified:
    incubator/ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java
    incubator/ofbiz/trunk/applications/party/webapp/partymgr/party/findparty.ftl

Modified: incubator/ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java?view=diff&rev=478807&r1=478806&r2=478807
==============================================================================
--- incubator/ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java (original)
+++ incubator/ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java Fri Nov 24 00:55:00 2006
@@ -990,11 +990,11 @@
         }
 
         // 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 @@
                     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 @@
                     if (highIndex > partyListSize) {
                         highIndex = partyListSize;
                     }
-
+                    
                     // close the list iterator
                     pli.close();
                 } catch (GenericEntityException e) {

Modified: incubator/ofbiz/trunk/applications/party/webapp/partymgr/party/findparty.ftl
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/party/webapp/partymgr/party/findparty.ftl?view=diff&rev=478807&r1=478806&r2=478807
==============================================================================
--- incubator/ofbiz/trunk/applications/party/webapp/partymgr/party/findparty.ftl (original)
+++ incubator/ofbiz/trunk/applications/party/webapp/partymgr/party/findparty.ftl Fri Nov 24 00:55:00 2006
@@ -208,14 +208,12 @@
               <td width="50%">
                  <div class="boxhead" align="right">
                   <#if (partyListSize > 0)>
-                    <#if (viewIndex > 1)>
+                    <#if (viewIndex > 0)>
                       <a href="<@ofbizUrl>findparty?VIEW_SIZE=${viewSize}&amp;VIEW_INDEX=${viewIndex-1}&amp;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}&amp;VIEW_INDEX=${viewIndex+1}&amp;hideFields=${parameters.hideFields?default("N")}${paramList}</@ofbizUrl>" class="submenutextright">${uiLabelMap.CommonNext}</a>
                     <#else>