[cgiapp] Q: Any guidelines for paging thru db records via CGI params?

Dan Horne dan.horne at redbone.co.nz
Sun May 25 23:10:43 EDT 2008


Ron Savage said:
> Hi Folks
>
> Let's say I offered the user a form with 2 fields, id and (Winemaker's)
> name.
>
> The user enters B% for the name's value, and, using Rose, I know there
> are 18 matching records.
>
> But it happens I'm using a per_page of 10 (say) to call
> get_winemaker_iterator(), so the first call returns records 1 .. 10 to
> the user.
>
> What's a good way to display buttons so the user can page forward to get
> records 11 .. 18, and (later) back from page 2 to page 1?

I like Data::Page::Navigation. Each link for selecting a page would
include the search criteria including the page number. DBIx::Class offers
a database agnostic syntax for limiting the rows returned to the page
requested, so I guess Rose would too.



More information about the cgiapp mailing list