Update of /var/cvs/applications/searchrelate/examples
In directory james.mmbase.org:/tmp/cvs-serv17026

Modified Files:
        example4.jspx index.jspx 
Added Files:
        relatednodes.jspx 
Log Message:
added also an example for inline creating of new nodes


See also: http://cvs.mmbase.org/viewcvs/applications/searchrelate/examples


relatednodes.jspx is new



Index: example4.jspx
===================================================================
RCS file: /var/cvs/applications/searchrelate/examples/example4.jspx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- example4.jspx       14 Apr 2008 15:52:40 -0000      1.2
+++ example4.jspx       14 Apr 2008 16:09:55 -0000      1.3
@@ -1,22 +1,23 @@
 <div
     xmlns:jsp="http://java.sun.com/JSP/Page";
-    xmlns:c="http://java.sun.com/jsp/jstl/core";
     xmlns:mm="http://www.mmbase.org/mmbase-taglib-2.0";
     xmlns:mm-sr="http://www.mmbase.org/tags/mm/searchrelate";
     class="drawer">
-  <!--
-    xmlns:mm-sr="urn:jsptagdir:/WEB-INF/tags/mm/searchrelate/"
-
-    -->
   <jsp:output omit-xml-declaration="true" />
   <h1><a href="#example4">Example4</a></h1>
-  <p>
-    This example demonstrates mm-sr:relatednodes. An inline mmbase related 
nodes list editor.
-    Changes in nodes are commited directly. Deleting entries in this list will 
not delete (only)
-    delete the relation, but the related nodes itself. So this code actually 
assumes that the same
-    two nodes are never related mode than once.
-  </p>
-
-  <mm-sr:relatednodes type="news" role="posrel" />
-
+  <p>If a convenient node cannot be found. You may offer to option to create a 
new node</p>
+  <div>
+    <mm:relatednodescontainer role="posrel" type="news" id="current" >
+      <mm:sortorder field="posrel.pos" />
+      <mm:relatednodes id="currentlyRelated" />
+    </mm:relatednodescontainer>
+    <mm:listnodescontainer type="news" id="repository">
+      <mm:constraint field="number" operator="IN" referid="currentlyRelated" 
inverse="true" />
+    </mm:listnodescontainer>
+    <a id="submit4">Submit</a>
+    <mm-sr:relate repository="${repository}" current="${current}"
+                  submit="#submit3" unrelate="true"
+                  create="true"
+                  />
+  </div>
 </div>


Index: index.jspx
===================================================================
RCS file: /var/cvs/applications/searchrelate/examples/index.jspx,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- index.jspx  10 Apr 2008 15:58:55 -0000      1.9
+++ index.jspx  14 Apr 2008 16:09:55 -0000      1.10
@@ -46,6 +46,8 @@
             <mm:include page="example2.jspx" />
             <mm:include page="example3.jspx" />
             <mm:include page="example4.jspx" />
+
+            <mm:include page="relatednodes.jspx" />
           </mm:node>
         </mm:hasnode>
       </mm:cloud>
_______________________________________________
Cvs mailing list
Cvs@lists.mmbase.org
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to