svn commit: r510849 - /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: r510849 - /ofbiz/trunk/framework/images/webapp/images/fieldlookup.js

byersa-3
Author: byersa
Date: Thu Feb 22 22:54:31 2007
New Revision: 510849

URL: http://svn.apache.org/viewvc?view=rev&rev=510849
Log:
Put a test on the "this.args" to prevent lookup_popup2 from blowing up if there are none.

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?view=diff&rev=510849&r1=510848&r2=510849
==============================================================================
--- ofbiz/trunk/framework/images/webapp/images/fieldlookup.js (original)
+++ ofbiz/trunk/framework/images/webapp/images/fieldlookup.js Thu Feb 22 22:54:31 2007
@@ -59,7 +59,6 @@
     // passing methods
     this.popup    = lookup_popup1;
     this.popup2    = lookup_popup2;
-
     // validate input parameters
     if (!obj_target)
         return lookup_error("Error calling the field lookup: no target control specified");
@@ -86,10 +85,12 @@
 }
 function lookup_popup2 (view_name) {
     var argString = "";
-    if (this.args.length > 2) {
-        for(var i=2; i < this.args.length; i++) {
-            argString += "&parm" + (i-2) + "=" + this.args[i];
-        }
+    if (this.args != null) {
+    if (this.args.length > 2) {
+        for(var i=2; i < this.args.length; i++) {
+            argString += "&parm" + (i-2) + "=" + this.args[i];
+        }
+    }
     }
     var sep = "?";
     if (view_name.indexOf("?") >= 0) {
@@ -103,3 +104,4 @@
  alert (str_message);
  return null;
 }
+