svn commit: r732083 - /ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java

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

svn commit: r732083 - /ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java

adrianc
Author: adrianc
Date: Tue Jan  6 11:53:12 2009
New Revision: 732083

URL: http://svn.apache.org/viewvc?rev=732083&view=rev
Log:
Fixed a bug where a login prompt appeared in lookup windows when cookies are disabled - reported in https://issues.apache.org/jira/browse/OFBIZ-253.

Modified:
    ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java

Modified: ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java?rev=732083&r1=732082&r2=732083&view=diff
==============================================================================
--- ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java (original)
+++ ofbiz/trunk/framework/widget/src/org/ofbiz/widget/html/HtmlFormRenderer.java Tue Jan  6 11:53:12 2009
@@ -2201,7 +2201,7 @@
             writer.append(modelFormField.getParameterName(context));
             writer.append(",'");
         }
-        writer.append(lookupField.getFormName(context));
+        writer.append(appendExternalLoginKey(lookupField.getFormName(context)));
         writer.append("'");
         List targetParameterList = lookupField.getTargetParameterList();
         if (targetParameterList.size() > 0) {
@@ -2227,6 +2227,19 @@
         //appendWhitespace(writer);
     }
 
+    protected String appendExternalLoginKey(String target) {
+        String result = target;
+        String externalLoginKey = (String) this.request.getAttribute("externalLoginKey");
+        if (UtilValidate.isNotEmpty(externalLoginKey)) {
+            if (target.contains("?")) {
+                result = target + "&externalLoginKey=" + externalLoginKey;
+            } else {
+                result = target + "?externalLoginKey=" + externalLoginKey;
+            }
+        }
+        return result;
+    }
+
     public void renderNextPrev(Appendable writer, Map<String, Object> context, ModelForm modelForm) throws IOException {
         boolean ajaxEnabled = false;
         List<ModelForm.UpdateArea> updateAreas = modelForm.getOnPaginateUpdateAreas();