Hi Aaron,

Lots of ways of doing this depending on what you want to do. These days I
have a getMetaData() and setMetaData() method in the IBO to distinguish
between the actual object data which has n-records and the data I want to
know ABOUT the object which is only a single record. My service layer is
page aware and does a couple of things. Firstly it calls a SELECT count
based on a filter to see how many records match. It stored that using
setMetadata("TotalrecordCount", TotalRecordCount). I also have code that
allows you to set order, records per page, and that in the metadata returns
number of pages, page number, first record, last record and the like so then
you just need to iterate through the IBO as it has only been loaded with the
records you want to display.

Another approach would be to add two methods to the IBO firstRecord() and
islastRecord() and some way of setting those numbersinside the bean so then
instead of going to the first record, you'd call object.firstRecord() to go
to the first record in you set you want to display and you'd loop
conditionally while not isLastRecord() so that'd allow you to page through
the IBO.

Best Wishes,
Peter


On 4/12/07 7:41 PM, "Aaron Roberson" <[EMAIL PROTECTED]> wrote:

> In the past I would use the maxrows attribute of the cfoutput query
> tag to limit my "iterations" to a certain number. Now that I am
> returning an object from my service layer and iterating through it
> using the IBO, I am wondering how I can bring that same maxrow
> functionality back to my development process?
> 
> I know I could accept an argument in my getByAttributes() method and
> then check if it is emptey and include it in the query if not, but
> then I would have to add that functionality to all of my objects with
> a getByAtrributes method.
> 
> Any suggestions?
> 
> 
> You are subscribed to cfcdev. To unsubscribe, please follow the instructions
> at http://www.cfczone.org/listserv.cfm
> 
> CFCDev is supported by:
> Katapult Media, Inc.
> We are cool code geeks looking for fun projects to rock!
> www.katapultmedia.com
> 
> An archive of the CFCDev list is available at
> www.mail-archive.com/[EMAIL PROTECTED]
> 





You are subscribed to cfcdev. To unsubscribe, please follow the instructions at 
http://www.cfczone.org/listserv.cfm

CFCDev is supported by:
Katapult Media, Inc.
We are cool code geeks looking for fun projects to rock!
www.katapultmedia.com

An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL 
PROTECTED]

Reply via email to