Update of /var/cvs/applications/taglib/blocks/test
In directory james.mmbase.org:/tmp/cvs-serv19431

Modified Files:
        form.jspx 
Log Message:
added some c:catch and commitonclose


See also: http://cvs.mmbase.org/viewcvs/applications/taglib/blocks/test


Index: form.jspx
===================================================================
RCS file: /var/cvs/applications/taglib/blocks/test/form.jspx,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- form.jspx   19 Nov 2008 14:31:54 -0000      1.8
+++ form.jspx   19 Nov 2008 16:34:28 -0000      1.9
@@ -10,6 +10,8 @@
 
   <h3>Create in a form 2 new nodes and a relation between them</h3>
   <mm:form id="form1" mode="validate">
+    <c:catch var="e">
+
     <mm:createnode type="news" id="news" />
     <mm:createnode type="urls" id="url" />
     <mm:createrelation source="news" destination="url" role="posrel" id="r" />
@@ -21,10 +23,15 @@
       <p>Created relation: ${_node}: <mm:nodeinfo type="gui" /></p>
     </mm:node>
     <p>Created url: ${url}</p>
+    </c:catch>
+
   </mm:form>
+  <p>${e}</p>
 
   <h3>Create in a form 1 new node and a relation between that and an existing 
node</h3>
   <mm:form id="form2">
+    <c:catch var="e">
+
     <mm:createnode type="news" id="news2" />
     <mm:node number="${url}" id="url2" />
     <mm:createrelation source="news2" destination="url2" role="posrel" id="r2" 
/>
@@ -40,11 +47,15 @@
         <p>Created relation: ${_node}: <mm:nodeinfo type="gui" /></p>
       </mm:node>
     </mm:present>
+    </c:catch>
+
   </mm:form>
+  ${e}
 
   <h3>Actually show a form</h3>
+  <c:catch var="e">
   <mm:form id="form3">
-    <mm:createnode type="news" id="news3">
+      <mm:createnode type="news" id="news3" commitonclose="false"> <!-- TODO, 
perhaos it's better if commitonclose is false on default if node in transaction 
-->
       <mm:field name="title">
         <mm:fieldinfo type="input" />
         <mm:fieldinfo type="errors" />
@@ -67,20 +78,24 @@
       </mm:valid>
     </mm:present>
   </mm:form>
+  </c:catch>
+  <p>${e}</p>
 
   <h3>A form which can handle both new and existings nodes</h3>
   <mm:import externid="article">new</mm:import>
   <mm:form id="form4">
+    <c:catch>
+
     <c:choose>
       <c:when test="${article eq 'new'}">
         <mm:remove referid="article" />
-        <mm:createnode id="article" type="news" />
+          <mm:createnode id="article" type="news" commitonclose="false"/>
       </c:when>
       <c:otherwise>
         <input type="hidden" name="article" value="${article}" />
       </c:otherwise>
     </c:choose>
-    <mm:node  referid="article">
+      <mm:node  referid="article" commitonclose="false">
       <p>Number: ${_node}</p>
       <mm:field name="title">
         <mm:fieldinfo type="input" />
@@ -103,18 +118,23 @@
         </mm:node>
       </mm:valid>
     </mm:present>
+    </c:catch>
+
   </mm:form>
 
   <h3>Split up in 2 mm:forms</h3>
   <mm:form name="form5" mode="transaction"> <!-- if mode trnasaction a html 
form is avoided -->
+    <c:catch>
     <mm:createnode type="news" id="news5">
       <mm:field name="title">
         <mm:fieldinfo type="input" />
         <mm:fieldinfo type="errors" />
       </mm:field>
     </mm:createnode>
+    </c:catch>
   </mm:form>
   <mm:form id="form5" name="form5">
+    <c:catch>
     <input type="submit" name="submit5" />
     <mm:import externid="submit5" />
     <mm:present referid="submit5">
@@ -128,6 +148,7 @@
         </mm:node>
       </mm:valid>
     </mm:present>
+    </c:catch>
   </mm:form>
 
 
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to