Update of /var/cvs/applications/editwizard/templates/javascript
In directory james.mmbase.org:/tmp/cvs-serv24972/templates/javascript

Modified Files:
        editwizard.jsp 
Log Message:
Add a ;main' attribute to search (similar to main from the wizard list jsp, to 
specify the main builder in a nodepath)


See also: 
http://cvs.mmbase.org/viewcvs/applications/editwizard/templates/javascript


Index: editwizard.jsp
===================================================================
RCS file: /var/cvs/applications/editwizard/templates/javascript/editwizard.jsp,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -b -r1.75 -r1.76
--- editwizard.jsp      28 Nov 2008 16:51:01 -0000      1.75
+++ editwizard.jsp      27 Feb 2009 12:11:30 -0000      1.76
@@ -5,7 +5,7 @@
  * and validation (in validator.js)
  *
  * @since    MMBase-1.6
- * @version  $Id: editwizard.jsp,v 1.75 2008/11/28 16:51:01 michiel Exp $
+ * @version  $Id: editwizard.jsp,v 1.76 2009/02/27 12:11:30 pierre Exp $
  * @author   Kars Veling
  * @author   Pierre van Rooden
  * @author   Nico Klasens
@@ -93,7 +93,6 @@
 // onunload handler with one of his own. It is hard to override that one,
 // because a timer is used to wait a while before attaching it.
 // In short, DON'T USE OR OVERRIDE THIS FUNCTION.
-    //
 }
 
 
@@ -158,16 +157,18 @@
     var directions = el.getAttribute("directions");
     var searchdir = el.getAttribute("searchdir");
     var distinct   = el.getAttribute("distinct");
+    var main  = el.getAttribute("main");
     var pagelength = el.getAttribute("pagelength");
     if (!pagelength) {
         pagelength = 10;
     }
 
-    // lastobject is generally the last builder in the nodepath.
+    // lastobject is generally the last builder in the nodepath or the builder 
in 'main'.
     // however, if the first field is a "<buildername>.number" field, that 
buildername is used
 
-    var tmp=nodepath.split(",");
-    var lastobject="";
+    var lastobject = main;
+    if (lastobject == "" || lastobject == null) {
+        var tmp = nodepath.split(",");
     if (tmp.length>1) {
         lastobject=tmp[tmp.length-1];
         tmp=fields.split(",");
@@ -175,6 +176,7 @@
             lastobject=tmp[0].split(".")[0];
         }
     }
+    }
 
     // check constraints
     var cs = searchfields.split("|");
@@ -230,6 +232,7 @@
     url += setParam("directions", directions);
     url += setParam("searchdir", searchdir);
     url += setParam("distinct", distinct);
+    url += setParam("main", main);
     url += setParam("age", searchage+"");
     url += setParam("type", el.getAttribute("type"));
 
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to