Update of /var/cvs/applications/searchrelate/META-INF/tags/mm/searchrelate
In directory james.mmbase.org:/tmp/cvs-serv24862/META-INF/tags/mm/searchrelate

Modified Files:
        tabs.tagx 
Log Message:



See also: 
http://cvs.mmbase.org/viewcvs/applications/searchrelate/META-INF/tags/mm/searchrelate


Index: tabs.tagx
===================================================================
RCS file: 
/var/cvs/applications/searchrelate/META-INF/tags/mm/searchrelate/tabs.tagx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- tabs.tagx   1 Jul 2008 08:22:15 -0000       1.1
+++ tabs.tagx   1 Jul 2008 15:40:17 -0000       1.2
@@ -33,6 +33,17 @@
                            description="As page attribute of mm:url, used to 
generate the urls. Defaults to empty string (current page)"
                            />
 
+  <jsp:directive.attribute name="gonext" type="java.lang.Boolean"
+                           description="Automaticly go to next tab if pressed 
on save"
+                           />
+
+  <jsp:directive.attribute name="closelast" type="java.lang.Boolean"
+                           description="Automaticly call window.close if 
pressed on save in last tab"
+                           />
+
+  <jsp:directive.attribute name="intro" fragment="true"
+                           />
+
   <mm:import id="e">.${empty extension ? 'jspx' : extension}</mm:import>
   <mm:import id="p" externid="path" from="this" vartype="list">${empty path ? 
'a,b,c' : path}</mm:import>
   <mm:import id="f" externid="form" from="this">${empty form ? 'form' : 
form}</mm:import>
@@ -75,12 +86,6 @@
             </mm:treehaspage>
           </mm:import>
 
-          <mm:import id="tabClass">
-            <mm:treehaspage page="${directory}${q}${e}" 
objectlist="${objectlist}">
-              <x:out select="$source/*/@class" />
-            </mm:treehaspage>
-          </mm:import>
-
 
           <mm:write referid="title" write="true">
             <mm:isempty>${q}</mm:isempty>
@@ -99,42 +104,54 @@
 
 
   <div class="tabs">
+    <x:parse var="currentsource">
+      <mm:treeinclude cite="true" objectlist="${objectlist}" 
page="${directory}${currentpage}${e}" />
+    </x:parse>
+    <mm:import id="tabClass">
+      <mm:treehaspage page="${directory}${currentpage}${e}" 
objectlist="${objectlist}">
+        <x:out select="$currentsource/*/@class" />
+      </mm:treehaspage>
+    </mm:import>
+
     <h1>
       <span class="index"><jsp:text>${current + 1} / ${fn:length(p)} 
</jsp:text></span>
       ${empty currentpagetitle ? currentpage : currentpagetitle}
     </h1>
-    <script type="text/javascript">
-      if (typeof(window["MMBaseValidator"]) != "undefined") {
-      var val = new MMBaseValidator(window);
-      }
-    </script>
       <div class="top links">
         <mm:write referid="tabs" escape="none" />
       </div>
       <div class="body ${currentpage}${e} ${styleClass}">
         <mm:compare referid="tabClass" regexp=".*\boutside\b.*">
+          <jsp:invoke fragment="intro" />
           <mm:treeinclude debug="html" notfound="message" 
page="${directory}${currentpage}${e}" objectlist="${objectlist}" />
         </mm:compare>
         <mm:form page="" id="${f}_form"  jspvar="transaction">
           <mm:import id="cancel" externid="${f}_cancel" />
           <mm:present referid="cancel">
-            <mm:log>Canceling</mm:log>
             <mm:cancel />
+            <mm:log>Canceling <jsp:expression>transaction</jsp:expression>
+            <jsp:expression>transaction.isCanceled()</jsp:expression>
+            </mm:log>
             <script type="text/javascript">
+              $(document).ready(function() {
               window.location = '<mm:url page="${page}"><mm:param 
name="${f}">${currentpage}</mm:param></mm:url>'
+              });
             </script>
           </mm:present>
           <mm:notpresent referid="cancel">
             <mm:compare referid="tabClass" regexp=".*\boutside\b.*" 
inverse="true">
+              <jsp:invoke fragment="intro" />
               <mm:treeinclude debug="html" notfound="message" 
page="${directory}${currentpage}${e}" objectlist="${objectlist}" />
             </mm:compare>
 
+            <div class="buttons">
             <c:if test="${empty nosubmit}">
               <input type="submit" name="${f}_submit" id="${f}_submit" 
value="Sla op" />
               <input type="submit" name="${f}_cancel" id="${f}_cancel" 
value="Annuleer" />
             </c:if>
             <input type="hidden" name="${f}" value="${currentpage}" />
             <input type="hidden" name="${f}_next" id="${f}_next" value="" />
+            </div>
 
             <mm:valid>
               <mm:import externid="${f}_next" id="next" />
@@ -142,24 +159,37 @@
 
               <mm:import id="submit" externid="${f}_submit" />
               <mm:present referid="submit">
-                <mm:log>committing</mm:log>
+                <mm:log>committing 
<jsp:expression>transaction</jsp:expression></mm:log>
                 <mm:commit />
+                <c:if test="${empty next}">
+                  <script type="text/javascript">
+                    $(document).ready(function() {
+                    window.location = '<mm:url page="${page}"><mm:param 
name="${f}">${currentpage}</mm:param></mm:url>';
+                    });
+                  </script>
+                </c:if>
               </mm:present>
 
               <script type="text/javascript">
                 <c:choose>
                   <c:when test="${! empty submit}">
                     <c:choose>
-                      <c:when test="${empty p[current + 1]}">
+                      <c:when test="${(empty closelast or closelast) and empty 
p[current + 1]}">
+                        $(document).ready(function() {
                         window.close();
+                        });
                       </c:when>
-                      <c:otherwise>
+                      <c:when test="${empty gonext or gonext}">
+                        $(document).ready(function() {
                         window.location = '<mm:url page="${page}"><mm:param 
name="${f}">${p[current + 1]}</mm:param></mm:url>';
-                      </c:otherwise>
+                        });
+                      </c:when>
                     </c:choose>
                   </c:when>
                   <c:when test="${! empty next}">
+                    $(document).ready(function() {
                     window.location = '<mm:url page="${page}"><mm:param 
name="${f}">${next}</mm:param></mm:url>';
+                     });
                   </c:when>
                   <c:otherwise>
                     //alert("don't know what to do");
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to