<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>RE : batch next previous</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>Hello world !</FONT>
<BR><FONT SIZE=2>In your ZMI, you can add a &quot;Z Search interface&quot;, </FONT>
<BR><FONT SIZE=2>where you select your &quot;ZSql method&quot;.</FONT>
<BR><FONT SIZE=2>You have a radio button &quot;Generate page template&quot;, </FONT>
<BR><FONT SIZE=2>you'll see the code generated for multi-pages :</FONT>
<BR><FONT SIZE=2>it looks like that (for my application) :</FONT>
</P>

<P><FONT SIZE=2>&lt;div metal:define-macro=&quot;listemaires&quot;&gt;</FONT>
<BR><FONT SIZE=2>&nbsp; &lt;body tal:define=&quot;results&nbsp; here/select_maires;</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; start request/start|python:0;</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; batch python:modules['ZTUtils'].Batch(results, </FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; size=20, </FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; start=start);</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; previous python:batch.previous;</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; next python:batch.next&quot;&gt;</FONT>
</P>

<P><FONT SIZE=2>&nbsp; &lt;p&gt;</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp; &lt;a tal:condition=&quot;previous&quot;</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tal:attributes=&quot;href string:${request/URL0}?start:int=${previous/first}&quot;</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; href=&quot;previous_url&quot;&gt;previous &lt;span tal:replace=&quot;previous/length&quot;&gt;20&lt;/span&gt; results&lt;/a&gt;</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp; &lt;a tal:condition=&quot;next&quot;</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tal:attributes=&quot;href string:${request/URL0}?start:int=${next/first}&quot;</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; href=&quot;next_url&quot;&gt;next &lt;span tal:replace=&quot;next/length&quot;&gt;20&lt;/span&gt; results&lt;/a&gt;</FONT>
<BR><FONT SIZE=2>&nbsp; &lt;/p&gt;</FONT>
</P>

<P><FONT SIZE=2>&nbsp; &lt;table border&gt;</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;tr&gt;</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;th&gt;Id&lt;/th&gt;</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;th&gt;Communes&lt;/th&gt;</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;th&gt;N canton&lt;/th&gt;</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .........</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .........</FONT>
</P>
<BR>

<P><FONT SIZE=2>After the &lt;/table&gt;, you have :</FONT>
</P>

<P><FONT SIZE=2>&nbsp; &lt;p&gt;</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp; &lt;a tal:condition=&quot;previous&quot;</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tal:attributes=&quot;href string:${request/URL0}?start:int=${previous/first}&quot;</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; href=&quot;previous_url&quot;&gt;previous &lt;span tal:replace=&quot;previous/length&quot;&gt;20&lt;/span&gt; results&lt;/a&gt;</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp; &lt;a tal:condition=&quot;next&quot;</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tal:attributes=&quot;href string:${request/URL0}?start:int=${next/first}&quot;</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; href=&quot;next_url&quot;&gt;next &lt;span tal:replace=&quot;next/length&quot;&gt;20&lt;/span&gt; results&lt;/a&gt;</FONT>
<BR><FONT SIZE=2>&nbsp; &lt;/p&gt;</FONT>
</P>

<P><FONT SIZE=2>&nbsp; &lt;/body&gt;</FONT>
<BR><FONT SIZE=2>&lt;/div&gt;</FONT>
</P>

<P><FONT SIZE=2>&quot;select_maires&quot; is my zsql method.</FONT>
<BR><FONT SIZE=2>It runs on Fedora and Red Hat, CPS 3.2.4, python 2.3.4</FONT>
</P>

<P><FONT SIZE=2>Patrick Maynard.</FONT>
</P>
<BR>
<BR>

<P><FONT SIZE=2>Message: 1</FONT>
<BR><FONT SIZE=2>Date: Fri, 26 Jan 2007 14:37:24 +0100 (CET)</FONT>
<BR><FONT SIZE=2>From: Graziella Toutoungis &lt;graztoutoungis@yahoo.fr&gt;</FONT>
<BR><FONT SIZE=2>Subject: [CPS-users] batch next previous</FONT>
<BR><FONT SIZE=2>To: cps-users@lists.nuxeo.com</FONT>
<BR><FONT SIZE=2>Message-ID: &lt;93604.14052.qm@web27004.mail.ukl.yahoo.com&gt;</FONT>
<BR><FONT SIZE=2>Content-Type: text/plain; charset=iso-8859-1</FONT>
</P>

<P><FONT SIZE=2>hello,</FONT>
</P>

<P><FONT SIZE=2>I have a page template for showing the result of a</FONT>
<BR><FONT SIZE=2>table. i want to do a next and a previous button.</FONT>
<BR><FONT SIZE=2>some body can help me i tried some batch code but with</FONT>
<BR><FONT SIZE=2>no success.</FONT>
</P>

<P><FONT SIZE=2>my table is</FONT>
<BR><FONT SIZE=2>&lt;table border=&quot;1&quot; align=&quot;center&quot; width=&quot;100%&quot;</FONT>
<BR><FONT SIZE=2>cellspacing=&quot;0&quot; cellpadding=&quot;2&quot;&gt;</FONT>
<BR><FONT SIZE=2>&nbsp;&lt;tbody&gt;</FONT>
<BR><FONT SIZE=2>&nbsp;&lt;tr bgcolor=&quot;#ece9d8&quot;&gt; </FONT>
<BR><FONT SIZE=2>&nbsp;&lt;th&gt;id&lt;/th&gt;</FONT>
<BR><FONT SIZE=2>&nbsp;&lt;th&gt;customer&lt;/th&gt;</FONT>
<BR><FONT SIZE=2>&nbsp;&lt;th&gt;phone&lt;/th&gt;</FONT>
</P>

<P><FONT SIZE=2>&nbsp;&lt;/tr&gt;</FONT>
<BR><FONT SIZE=2>&nbsp;&lt;tr align=&quot;right&quot; bgcolor=&quot;#ffffff&quot; tal:repeat=&quot;items here/ref_zsql&quot;&gt; </FONT>
<BR><FONT SIZE=2>&nbsp;&lt;td align=&quot;left&quot; tal:content=&quot;items/id&quot;&gt;id&lt;/td&gt;</FONT>
<BR><FONT SIZE=2>&nbsp;&lt;td align=&quot;left&quot; tal:content=&quot;items/name&quot;&gt;name&lt;/td&gt;</FONT>
<BR><FONT SIZE=2>&nbsp;&lt;td align=&quot;left&quot; tal:content=&quot;items/phone&quot;&gt;&lt;/td&gt;</FONT>
<BR><FONT SIZE=2>&nbsp;&lt;/tr&gt;</FONT>
<BR><FONT SIZE=2>&nbsp;&lt;/tbody&gt;</FONT>
<BR><FONT SIZE=2>&nbsp;&lt;/table&gt;</FONT>
<BR><FONT SIZE=2>thanks</FONT>
<BR><FONT SIZE=2>&nbsp;G.</FONT>
</P>
<BR>
<BR>
<BR>

<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</P>

<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<BR><FONT SIZE=2>___________________________________________________________________________ </FONT>
<BR><FONT SIZE=2>Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! </FONT>
<BR><FONT SIZE=2>Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses </FONT>
<BR><FONT SIZE=2><A HREF="http://fr.answers.yahoo.com" TARGET="_blank">http://fr.answers.yahoo.com</A></FONT>
</P>
<BR>

<P><FONT SIZE=2>------------------------------</FONT>
</P>

<P><FONT SIZE=2>_______________________________________________</FONT>
<BR><FONT SIZE=2>cps-users mailing list</FONT>
<BR><FONT SIZE=2>cps-users@lists.nuxeo.com <A HREF="http://lists.nuxeo.com/mailman/listinfo/cps-users" TARGET="_blank">http://lists.nuxeo.com/mailman/listinfo/cps-users</A></FONT>
</P>
<BR>

<P><FONT SIZE=2>End of cps-users Digest, Vol 42, Issue 6</FONT>
<BR><FONT SIZE=2>****************************************</FONT>
</P>

</BODY>
</HTML>