svn commit: r1768150 - in /ofbiz/trunk: applications/party/widget/partymgr/PartyForms.xml framework/widget/src/main/java/org/apache/ofbiz/widget/WidgetWorker.java

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

svn commit: r1768150 - in /ofbiz/trunk: applications/party/widget/partymgr/PartyForms.xml framework/widget/src/main/java/org/apache/ofbiz/widget/WidgetWorker.java

Arun Patidar-4
Author: arunpatidar
Date: Sat Nov  5 05:08:16 2016
New Revision: 1768150

URL: http://svn.apache.org/viewvc?rev=1768150&view=rev
Log:
Fixed: Page bottom navigation problem with grid and include-grid
(OFBIZ-7648)

Thanks: Rohit Koushal and Rishi Solanki for the contribution.

Modified:
    ofbiz/trunk/applications/party/widget/partymgr/PartyForms.xml
    ofbiz/trunk/framework/widget/src/main/java/org/apache/ofbiz/widget/WidgetWorker.java

Modified: ofbiz/trunk/applications/party/widget/partymgr/PartyForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/widget/partymgr/PartyForms.xml?rev=1768150&r1=1768149&r2=1768150&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/widget/partymgr/PartyForms.xml (original)
+++ ofbiz/trunk/applications/party/widget/partymgr/PartyForms.xml Sat Nov  5 05:08:16 2016
@@ -142,8 +142,6 @@ under the License.
                 <field-map field-name="partyId" from-field="partyId"/>
                 <field-map field-name="userLogin" from-field="userLogin"/>
             </service>
-            <!-- NO_PAGINATOR is set to 'true' to prevent PAGINATOR_NUMBER to increase when we use sub-grid under a grid -->
-            <set field="globalContext.NO_PAGINATOR" value="true" type="Boolean"/>
         </row-actions>
         <field name="partyId" sort-field="true">
             <hyperlink target="viewprofile" description="${partyId}">

Modified: ofbiz/trunk/framework/widget/src/main/java/org/apache/ofbiz/widget/WidgetWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/main/java/org/apache/ofbiz/widget/WidgetWorker.java?rev=1768150&r1=1768149&r2=1768150&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/main/java/org/apache/ofbiz/widget/WidgetWorker.java (original)
+++ ofbiz/trunk/framework/widget/src/main/java/org/apache/ofbiz/widget/WidgetWorker.java Sat Nov  5 05:08:16 2016
@@ -370,12 +370,15 @@ public final class WidgetWorker {
 
     public static int getPaginatorNumber(Map<String, Object> context) {
         int paginator_number = 0;
-        Map<String, Object> globalCtx = UtilGenerics.checkMap(context.get("globalContext"));
-        if (globalCtx != null) {
-            Integer paginateNumberInt= (Integer)globalCtx.get("PAGINATOR_NUMBER");
+        if (context != null) {
+            Integer paginateNumberInt= (Integer)context.get("PAGINATOR_NUMBER");
             if (paginateNumberInt == null) {
                 paginateNumberInt = Integer.valueOf(0);
-                globalCtx.put("PAGINATOR_NUMBER", paginateNumberInt);
+                context.put("PAGINATOR_NUMBER", paginateNumberInt);
+                Map<String, Object> globalCtx = UtilGenerics.checkMap(context.get("globalContext"));
+                if (globalCtx != null) {
+                    globalCtx.put("PAGINATOR_NUMBER", paginateNumberInt);
+                }
             }
             paginator_number = paginateNumberInt.intValue();
         }
@@ -389,8 +392,13 @@ public final class WidgetWorker {
             if (UtilValidate.isNotEmpty(NO_PAGINATOR)) {
                 globalCtx.remove("NO_PAGINATOR");
             } else {
-                Integer paginateNumberInt = Integer.valueOf(getPaginatorNumber(context) + 1);
+                Integer paginateNumberInt= (Integer)globalCtx.get("PAGINATOR_NUMBER");
+                if (paginateNumberInt == null) {
+                    paginateNumberInt = Integer.valueOf(0);
+                }
+                paginateNumberInt = Integer.valueOf(paginateNumberInt.intValue() + 1);
                 globalCtx.put("PAGINATOR_NUMBER", paginateNumberInt);
+                context.put("PAGINATOR_NUMBER", paginateNumberInt);
             }
         }
     }