<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.5730.11" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=720133416-31052007><FONT face=Arial 
color=#0000ff size=2>You know I had considered using JS for dealing with this. 
It does make it much easier to change the CSS on your links to indicate current 
page and such. I might look into this again. Thanks!</FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> 
zope-bounces+programmer=paradigm-corp.com@zope.org 
[mailto:zope-bounces+programmer=paradigm-corp.com@zope.org] <B>On Behalf Of 
</B>SpiderX<BR><B>Sent:</B> Thursday, May 31, 2007 11:25 AM<BR><B>To:</B> 
zope@zope.org<BR><B>Subject:</B> Re: [Zope] a batch of 
inSaNitY!<BR></FONT><BR></DIV>
<DIV></DIV>I just use Adobe Labs Spry Framework... this effectively puts the 
paging in javascript.<BR><BR>
<DIV><SPAN class=gmail_quote>On 5/31/07, <B 
class=gmail_sendername>Programmer</B> &lt;<A 
href="mailto:programmer@paradigm-corp.com"> programmer@paradigm-corp.com</A>&gt; 
wrote:</SPAN>
<BLOCKQUOTE class=gmail_quote 
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">Hi 
  Jonathan,<BR><BR>I have something similar to your idea already. The python 
  script <BR>supplies page number to a stored procedure which handles the 
  actual<BR>paging. The script takes the result from the proc and builds an 
  html<BR>table and handles column sorting on the table. The output of the 
  script<BR>is just a single variable so I can just use &amp;dtml-var instead of 
  the<BR>flaky &amp;dtml-in.<BR>Problem I have now is this new search interface 
  makes use of full-text<BR>searching on SQL Server 2K. The paging proc wasn't 
  written to handle it <BR>and will need to be rewritten from scratch. This will 
  take a lot of time<BR>and testing. I thought I could slap something simple and 
  fast together<BR>to use in the interim to allow people to start testing the 
  search<BR>engine.<BR><BR>I really do wish Zope would either fix or eliminate 
  broken features. At<BR>the very least have the curtesy to say "hey y'all, this 
  is broke, don't<BR>bother" so folks don't waste time with it. 
  <BR><BR>Mike<BR><BR>-----Original Message-----<BR>From: Jonathan [mailto:<A 
  href="mailto:dev101@magma.ca">dev101@magma.ca</A>]<BR>Sent: Wednesday, May 30, 
  2007 5:22 PM<BR>To: Programmer; <A href="mailto:zope@zope.org">zope@zope.org 
  </A><BR>Subject: Re: [Zope] a batch of inSaNitY!<BR><BR><BR>----- Original 
  Message -----<BR>From: "Programmer" &lt;<A 
  href="mailto:programmer@paradigm-corp.com">programmer@paradigm-corp.com</A>&gt;<BR>To: 
  &lt;<A href="mailto:zope@zope.org"> zope@zope.org</A>&gt;<BR>Sent: Wednesday, 
  May 30, 2007 4:44 PM<BR>Subject: [Zope] a batch of inSaNitY!<BR><BR><BR>&gt; 
  Hi<BR>&gt;<BR>&gt; I am about to go stark, raving, frothing mad with the 
  DTML-IN<BR>batching.<BR>&gt; Is there a known (or unknown) bug with this? 
  <BR>&gt;<BR>&gt; I have searched and read everything I can find about this and 
  no luck.<BR>&gt; The problem is with carrying the query terms over from one 
  batch page<BR>to<BR>&gt; the next. Right now I am using the script found here: 
  <BR>&gt;<BR><A 
  href="http://mail.zope.org/pipermail/zope-collector-monitor/2003-May/002001.ht">http://mail.zope.org/pipermail/zope-collector-monitor/2003-May/002001.ht</A><BR>&gt; 
  ml<BR>&gt;<BR>&gt; Except I changed,<BR>&gt; <BR>&gt; 
  &lt;dtml-let<BR>&gt;&nbsp;&nbsp;batch="_.range(100, 
  180)"<BR>&gt;&nbsp;&nbsp;batch_size="10"<BR>&gt;&nbsp;&nbsp;batch_start="REQUEST.get('batch_start',1)"&gt;<BR>&gt;<BR>&gt; 
  To<BR>&gt;<BR>&gt; &lt;dtml-let 
  <BR>&gt;&nbsp;&nbsp;batch="myZSQLMethod1"<BR>&gt;&nbsp;&nbsp;batch_size="10"<BR>&gt;&nbsp;&nbsp;batch_start="REQUEST.get('batch_start',1)"&gt;<BR>&gt;<BR>&gt; 
  The mySQLMethod1 takes two params which the search form supplies to <BR>&gt; 
  REQUEST. This works great. The pagination works beautifully. However,<BR>&gt; 
  when I use the very same result script with myZSQLMethod2 (same DB<BR>&gt; 
  table), which takes 5 params (all optional) the pagination breaks and <BR>&gt; 
  no-longer passes the query terms.<BR>&gt; I have checked and rechecked both 
  scripts and both forms. The<BR>&gt; ZSQLMethods both test good. I am out of 
  ideas. For the life of me I<BR>&gt; cannot figure out why I'm losing my query 
  terms in one and not the <BR>other<BR>&gt; when the two are almost 
  identical.<BR>&gt; Care to enlighten me with your collective wisdom?<BR><BR>In 
  similar situations I have done the following:<BR><BR>1) call a python 
  script/external method which: (i) does the db search; <BR>(ii)<BR>formats the 
  results as required for display; (iii) returns a tuple that<BR>contains: list 
  of search results, url parameters for 'previous' link;<BR>url<BR>parameters 
  for 'next' link; url parameters for 'first link'; url <BR>parameters<BR>for 
  'last' link<BR><BR>2) use a dtml method to call the script/ext.method 
  like<BR><BR>&lt;dtml-let rStat="mySearchRoutine(parm1, parm1, 
  ...)"&gt;<BR><BR>&nbsp;&nbsp;&lt;dtml-in "rStat[0]"&gt; 
  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;display code here 
  eg.&nbsp;&nbsp;&lt;dtml-var 
  sequence-item&gt;&lt;br&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;or could be 
  an html/css table, etc.<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp; &lt;dtml-if 
  sequence-end&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;a 
  href="...?&lt;dtml-var "rStat[1]"&gt;"&gt;previous&lt;/a&gt; 
  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;a 
  href="...?&lt;dtml-var 
  "rStat[2]"&gt;"&gt;next&lt;/a&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &lt;a href="...?&lt;dtml-var 
  "rStat[3]"&gt;"&gt;first&lt;/a&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  &lt;a href="...?&lt;dtml-var "rStat[4]"&gt;"&gt;last&lt;/a&gt; 
  <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/dtml-if&gt;<BR><BR>&nbsp;&nbsp;&lt;/dtml-in&gt;<BR>&lt;/dtml-let&gt;<BR><BR>This 
  greatly simplifies the dtml and facilitates debugging and 
  future<BR>modifications.<BR><BR>hth<BR><BR>Jonathan<BR><BR>_______________________________________________ 
  <BR>Zope maillist&nbsp;&nbsp;-&nbsp;&nbsp;<A 
  href="mailto:Zope@zope.org">Zope@zope.org</A><BR><A 
  href="http://mail.zope.org/mailman/listinfo/zope">http://mail.zope.org/mailman/listinfo/zope</A><BR>**&nbsp;&nbsp; 
  No cross posts or HTML encoding!&nbsp;&nbsp;**<BR>(Related lists -<BR><A 
  href="http://mail.zope.org/mailman/listinfo/zope-announce">http://mail.zope.org/mailman/listinfo/zope-announce</A><BR><A 
  href="http://mail.zope.org/mailman/listinfo/zope-dev">http://mail.zope.org/mailman/listinfo/zope-dev 
  </A>)<BR></BLOCKQUOTE></DIV><BR><BR clear=all><BR>-- <BR>Thanks,<BR>Derek Wilson 
</BODY></HTML>