You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by bp...@pacbell.net on 2001/11/03 00:16:54 UTC

Re: Pagination in Portlets (fwd)

Hugh-

I have a colleague who has just coded some pagination stuff, here is his
response to your mail...

-B

-- 
===========================
Brian Lawler

---------- Forwarded message ----------
Date: Fri, 02 Nov 2001 14:29:57 -0800
From: Corey Krehel <ck...@hotmail.com>
To: bplawler@pacbell.net
Subject: Re: Pagination in Portlets (fwd)

Hugh-
I recently had to impliment pagination on our site as well, and had to do it 
in the following way:
The following code uses velocity entirely to paginate a list of items.
I should note, however, that I was forced to do it this way because the 
context object that I was looping through was an Array not and ArrayList. An 
ArrayList would have made this easier to do as I could have looped through 
the arraylist and made smaller arrays based on the number of items to show 
per page (ie, 10 arrays of 20 items for 200 total items).  I dont know what 
you are going to be handling in the template, but If it is an arraylist, you 
should check look into the methods and properties of that util.

My script is attached, but, I should say that, given alternatives, its 
pretty hacky.  But if you are stuck using only velcoity to do this, it works 
really well.  Lastly, I expanded on this pagination to include drop down to 
display of all the ranges (1-10, 11-20, 21-30 etc).  I also created a drop 
down which allows users to choose the # of items to show per page (10, 20, 
30, etc).  It works pretty well with a little JS included.  Let me know if 
you want some info on that, but I think this script give enough info to 
figure out the rest.

Peace
Corey


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp

Re: Pagination in Portlets (fwd)

Posted by Hugh Brien <hp...@home.com>.
Thanks for the help.  I really appreciate it.
r,
Hugh


----- Original Message -----
From: <bp...@pacbell.net>
To: <tu...@jakarta.apache.org>
Sent: Friday, November 02, 2001 3:16 PM
Subject: Re: Pagination in Portlets (fwd)


> Hugh-
>
> I have a colleague who has just coded some pagination stuff, here is his
> response to your mail...
>
> -B
>
> --
> ===========================
> Brian Lawler
>
> ---------- Forwarded message ----------
> Date: Fri, 02 Nov 2001 14:29:57 -0800
> From: Corey Krehel <ck...@hotmail.com>
> To: bplawler@pacbell.net
> Subject: Re: Pagination in Portlets (fwd)
>
> Hugh-
> I recently had to impliment pagination on our site as well, and had to do
it
> in the following way:
> The following code uses velocity entirely to paginate a list of items.
> I should note, however, that I was forced to do it this way because the
> context object that I was looping through was an Array not and ArrayList.
An
> ArrayList would have made this easier to do as I could have looped through
> the arraylist and made smaller arrays based on the number of items to show
> per page (ie, 10 arrays of 20 items for 200 total items).  I dont know
what
> you are going to be handling in the template, but If it is an arraylist,
you
> should check look into the methods and properties of that util.
>
> My script is attached, but, I should say that, given alternatives, its
> pretty hacky.  But if you are stuck using only velcoity to do this, it
works
> really well.  Lastly, I expanded on this pagination to include drop down
to
> display of all the ranges (1-10, 11-20, 21-30 etc).  I also created a drop
> down which allows users to choose the # of items to show per page (10, 20,
> 30, etc).  It works pretty well with a little JS included.  Let me know if
> you want some info on that, but I think this script give enough info to
> figure out the rest.
>
> Peace
> Corey
>
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
>


----------------------------------------------------------------------------
----


> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>