svn commit: r831166 - /ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTree.java

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

svn commit: r831166 - /ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTree.java

bibryam
Author: bibryam
Date: Fri Oct 30 00:10:59 2009
New Revision: 831166

URL: http://svn.apache.org/viewvc?rev=831166&view=rev
Log:
Add request parameters to the links created by tree widgets.

Modified:
    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTree.java

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTree.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTree.java?rev=831166&r1=831165&r2=831166&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTree.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/tree/ModelTree.java Fri Oct 30 00:10:59 2009
@@ -20,6 +20,7 @@
 
 import java.io.IOException;
 import java.io.StringWriter;
+import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.ListIterator;
@@ -36,6 +37,7 @@
 import org.ofbiz.base.util.StringUtil;
 import org.ofbiz.base.util.UtilFormatOut;
 import org.ofbiz.base.util.UtilGenerics;
+import org.ofbiz.base.util.UtilHttp;
 import org.ofbiz.base.util.UtilMisc;
 import org.ofbiz.base.util.UtilValidate;
 import org.ofbiz.base.util.UtilXml;
@@ -177,6 +179,21 @@
             else
                 expColReq = s1;
         }
+        
+        //append also the request parameters
+        Map<String, Object> paramMap = UtilGenerics.checkMap(context.get("requestParameters"));
+        if (UtilValidate.isNotEmpty(paramMap)) {
+            Map<String, Object> requestParameters = new HashMap<String, Object>(paramMap);
+            requestParameters.remove(this.getTrailName(context));          
+            String queryString = UtilHttp.urlEncodeArgs(requestParameters, false);
+            if (expColReq.indexOf("?") < 0) {
+                expColReq += "?";
+            } else {
+                expColReq += "&";
+            }
+            expColReq += queryString;        
+        }
+        
         return expColReq;
     }