[thelist] Pagination in CFMX

Joshua Olson joshua at waetech.com
Fri Jan 16 08:31:56 CST 2004


----- Original Message ----- 
From: "Russ" <russ at unrealisticexpectations.com>
Sent: Friday, January 16, 2004 3:12 AM


> I'm trying to do simple (ha!) pagination in ColdFusion MX.  I would
> think it should be fairly simple, but the examples that I'm seeing
> appear to fairly complex, so I was wondering if anyone had any advice as
> to a relatively simple way to achieve this:

Russ,

It seems that you may be asking two questions.  One, "what are the basic
concepts involved in pagination and what resources does CF have available to
assist?"  Two, "how do I code it!?"

Theoretically, there are at least two basic options for CF pagination:

1.  Query the entire recordset and then only output a subset of that
recordset depending on which page you are viewing.  The cfoutput tag accepts
the "startrow" and "maxrow" attributes that indicate which records to loop
though.  This is the simpler of the two methods, but incurs a relatively
higher overhead since the entire SELECT query needs to be executed for every
page, no matter how many records it returns.

2.  Prenumber the records in the database based on the sort order by which
that the records should be returned.  Then, after somehow determining how
many records there are, query only those that you want and then generate the
pagination navigation to match.  This is a more complex method and will
require some basic table preparation, but could incur less overhead since
the SELECT query will only return those records that of actual concern.

For the second question of "how do I code it", please help us out by showing
us what you've got thus far and what approaches you plan on taking.  From
there, someone (perhaps myself) may be able to provide *pointers* on where
to go next.

Thanks, and good luck.

<><><><><><><><><><>
Joshua Olson
Web Application Engineer
WAE Tech Inc.
http://www.waetech.com/service_areas/
706.210.0168



More information about the thelist mailing list