Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: Users

dtml-in pagination

 

 

Zope users RSS feed   Index | Next | Previous | View Threaded


cybercruiserz at yahoo

Apr 7, 2009, 9:58 AM

Post #1 of 4 (1174 views)
Permalink
dtml-in pagination

Hi,

I'm trying to do pagination with dtml-in; could one of you show my why i can't get the next and previous button from my code below to work?

Also, i need to do view per page: 1,2,3,etc. and allow the user select the number of records displayed per page (size) as well. Thanks in advance for any advice.

<dtml-in "getTable(table=table,order_by=order_by,sort=sort)" size=10 start=0>
<dtml-if sequence-end>
<tr>
<td colspan=3>
<a href="?table=<dtml-var table>&order_by=<dtml-var order_by>&sort=<dtml-var sort>&start=<dtml-var previous-sequence>">previous</a>
<a href="?table=<dtml-var table>&order_by=<dtml-var order_by>&sort=<dtml-var sort>&start=<dtml-var next-sequence>">next</a>
</td>
</tr>
</dtml-if sequence-end>

</dtml-in>



_______________________________________________
Zope maillist - Zope [at] zope
http://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )


cybercruiserz at yahoo

Apr 7, 2009, 12:48 PM

Post #2 of 4 (1100 views)
Permalink
Re: dtml-in pagination [In reply to]

Could someone point me to some documentation on how to do pagination? Thanks.


--- On Tue, 4/7/09, Bobby <cybercruiserz [at] yahoo> wrote:

> From: Bobby <cybercruiserz [at] yahoo>
> Subject: [Zope] dtml-in pagination
> To: zope [at] zope
> Date: Tuesday, April 7, 2009, 10:58 AM
> Hi,
>
> I'm trying to do pagination with dtml-in; could one of
> you show my why i can't get the next and previous button
> from my code below to work?
>
> Also, i need to do view per page: 1,2,3,etc. and allow the
> user select the number of records displayed per page (size)
> as well. Thanks in advance for any advice.
>
> <dtml-in
> "getTable(table=table,order_by=order_by,sort=sort)"
> size=10 start=0>
> <dtml-if sequence-end>
> <tr>
> <td colspan=3>
> <a href="?table=<dtml-var
> table>&order_by=<dtml-var
> order_by>&sort=<dtml-var
> sort>&start=<dtml-var
> previous-sequence>">previous</a>
> <a href="?table=<dtml-var
> table>&order_by=<dtml-var
> order_by>&sort=<dtml-var
> sort>&start=<dtml-var
> next-sequence>">next</a>
> </td>
> </tr>
> </dtml-if sequence-end>
>
> </dtml-in>
>
>
>
> _______________________________________________
> Zope maillist - Zope [at] zope
> http://mail.zope.org/mailman/listinfo/zope
> ** No cross posts or HTML encoding! **
> (Related lists -
> http://mail.zope.org/mailman/listinfo/zope-announce
> http://mail.zope.org/mailman/listinfo/zope-dev )



_______________________________________________
Zope maillist - Zope [at] zope
http://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )


jeff.peterson at crary

Apr 8, 2009, 5:39 AM

Post #3 of 4 (1090 views)
Permalink
Re: dtml-in pagination [In reply to]

<dtml-if "REQUEST.has_key('b_start')">
<dtml-call "REQUEST.set('b_start',_.int(b_start))">
<dtml-else>
<dtml-call "REQUEST.set('b_start',0)">
</dtml-if>
<dtml-call "REQUEST.set('size', 3)">
<dtml-call "REQUEST.set('foods',['sandwiches', 'pie', 'meatloaf',
'berries', 'bread', 'coffee',
'some', 'thing', 'else'])">

<a href="?b_start=<dtml-var "b_start-size">">Previous <dtml-var size></a>
<dtml-in foods size=size orphan=1 start=b_start>


<p>
<dtml-var sequence-item>
</p>

</dtml-in>
<a href="?b_start=<dtml-var "b_start+size">">Next <dtml-var size></a>

From: http://www.zope.org/Members/peterbe/DTML2ZPT/

Incidently, this is a great resource for moving from DTML to page templates.

There are many examples of batching on ZopeLabs as well, from what I could see they are for ZPT though.

http://www.zopelabs.com

--
Jeffrey D Peterson
Webmaster
Crary Industries, Inc.


-----Original Message-----
From: zope-bounces [at] zope [mailto:zope-bounces [at] zope] On Behalf Of Bobby
Sent: Tuesday, April 07, 2009 2:48 PM
To: zope [at] zope
Subject: Re: [Zope] dtml-in pagination


Could someone point me to some documentation on how to do pagination? Thanks.


--- On Tue, 4/7/09, Bobby <cybercruiserz [at] yahoo> wrote:

> From: Bobby <cybercruiserz [at] yahoo>
> Subject: [Zope] dtml-in pagination
> To: zope [at] zope
> Date: Tuesday, April 7, 2009, 10:58 AM
> Hi,
>
> I'm trying to do pagination with dtml-in; could one of
> you show my why i can't get the next and previous button
> from my code below to work?
>
> Also, i need to do view per page: 1,2,3,etc. and allow the
> user select the number of records displayed per page (size)
> as well. Thanks in advance for any advice.
>
> <dtml-in
> "getTable(table=table,order_by=order_by,sort=sort)"
> size=10 start=0>
> <dtml-if sequence-end>
> <tr>
> <td colspan=3>
> <a href="?table=<dtml-var
> table>&order_by=<dtml-var
> order_by>&sort=<dtml-var
> sort>&start=<dtml-var
> previous-sequence>">previous</a>
> <a href="?table=<dtml-var
> table>&order_by=<dtml-var
> order_by>&sort=<dtml-var
> sort>&start=<dtml-var
> next-sequence>">next</a>
> </td>
> </tr>
> </dtml-if sequence-end>
>
> </dtml-in>
>
>
>
> _______________________________________________
> Zope maillist - Zope [at] zope
> http://mail.zope.org/mailman/listinfo/zope
> ** No cross posts or HTML encoding! **
> (Related lists -
> http://mail.zope.org/mailman/listinfo/zope-announce
> http://mail.zope.org/mailman/listinfo/zope-dev )



_______________________________________________
Zope maillist - Zope [at] zope
http://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )
_______________________________________________
Zope maillist - Zope [at] zope
http://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )


dieter at handshake

Apr 10, 2009, 1:01 AM

Post #4 of 4 (1072 views)
Permalink
Re: dtml-in pagination [In reply to]

Bobby wrote at 2009-4-7 09:58 -0700:
> <td colspan=3>
> <a href="?table=<dtml-var table>&order_by=<dtml-var order_by>&sort=<dtml-var sort>&start=<dtml-var previous-sequence>">previous</a>
> <a href="?table=<dtml-var table>&order_by=<dtml-var order_by>&sort=<dtml-var sort>&start=<dtml-var next-sequence>">next</a>
> </td>
></tr>
></dtml-if sequence-end>
>
></dtml-in>

Not sure, whether you will find it useful.
But, you may have a look at "http://www.handshake.de/~dieter/pyprojects/zope/book/chap3.html#c37ac15c14b4".
Search there for "4.3.5.2.3. Batch control".



--
Dieter
_______________________________________________
Zope maillist - Zope [at] zope
http://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )

Zope users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.