svn commit: r1053680 - /ofbiz/trunk/framework/images/webapp/images/fieldlookup.js

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

svn commit: r1053680 - /ofbiz/trunk/framework/images/webapp/images/fieldlookup.js

jaz-3
Author: jaz
Date: Wed Dec 29 17:41:03 2010
New Revision: 1053680

URL: http://svn.apache.org/viewvc?rev=1053680&view=rev
Log:
addressed issues with calling lookup forms with parameters (mainly when using layered lookups); instead of appending ?presentation now it will use the same logic used in other places to see if parameters exist

Modified:
    ofbiz/trunk/framework/images/webapp/images/fieldlookup.js

Modified: ofbiz/trunk/framework/images/webapp/images/fieldlookup.js
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/fieldlookup.js?rev=1053680&r1=1053679&r2=1053680&view=diff
==============================================================================
--- ofbiz/trunk/framework/images/webapp/images/fieldlookup.js (original)
+++ ofbiz/trunk/framework/images/webapp/images/fieldlookup.js Wed Dec 29 17:41:03 2010
@@ -112,7 +112,7 @@ function fieldLookup2(obj_target, obj_ta
 }
 
 function lookup_popup1(view_name, form_name, viewWidth, viewheight) {
-    var obj_lookupwindow = window.open(view_name + '?formName=' + form_name + '&presentation=' + this.presentation + '&id=' + this.id, '_blank', 'width=' + viewWidth + ',height=' + viewheight + ',scrollbars=yes,status=no,resizable=yes,top=' + my + ',left=' + mx + ',dependent=yes,alwaysRaised=yes');
+    var obj_lookupwindow = window.open(getViewNameWithSeparator(view_name) + 'formName=' + form_name + '&presentation=' + this.presentation + '&id=' + this.id, '_blank', 'width=' + viewWidth + ',height=' + viewheight + ',scrollbars=yes,status=no,resizable=yes,top=' + my + ',left=' + mx + ',dependent=yes,alwaysRaised=yes');
     obj_lookupwindow.opener = window;
     obj_lookupwindow.focus();
 }
@@ -125,11 +125,8 @@ function lookup_popup2(view_name) {
             }
         }
     }
-    var sep = "?";
-    if (view_name.indexOf("?") >= 0) {
-        sep = "&";
-    }
-    var obj_lookupwindow = window.open(view_name + sep + 'presentation=' + this.presentation + '&id=' + this.id + argString, '_blank', 'width=700,height=550,scrollbars=yes,status=no,resizable=yes,top=' + my + ',left=' + mx + ',dependent=yes,alwaysRaised=yes');
+    
+    var obj_lookupwindow = window.open(getViewNameWithSeparator(view_name) + 'presentation=' + this.presentation + '&id=' + this.id + argString, '_blank', 'width=700,height=550,scrollbars=yes,status=no,resizable=yes,top=' + my + ',left=' + mx + ',dependent=yes,alwaysRaised=yes');
     obj_lookupwindow.opener = window;
     obj_lookupwindow.focus();
 }
@@ -138,6 +135,14 @@ function lookup_error(str_message) {
     return null;
 }
 
+function getViewNameWithSeparator(view_name) {
+ var sep = "?";
+    if (view_name.indexOf("?") >= 0) {
+        sep = "&";
+    }
+    return view_name + sep;
+}
+
 function initiallyCollapse() {
     if ((!LOOKUP_DIV) || (INITIALLY_COLLAPSED != "true")) return;
     var slTitleBars = LOOKUP_DIV.getElementsByClassName('screenlet-title-bar');
@@ -180,7 +185,7 @@ function ConstructLookup(requestUrl, inp
     if(!presentation) {
       var presentation = "layer"
     }    
-    requestUrl = requestUrl + "?presentation=" + presentation;
+    requestUrl = getViewNameWithSeparator(requestUrl) + "presentation=" + presentation;
     
     // create Link Element with unique Key
     var lookupId = GLOBAL_LOOKUP_REF.createNextKey();