Re: ERXBatchingDisplayGroup question
Re: ERXBatchingDisplayGroup question
- Subject: Re: ERXBatchingDisplayGroup question
- From: Aaron Rosenzweig <email@hidden>
- Date: Thu, 12 Oct 2017 09:17:01 -0400
Hello Mark,
Your question is sound, thanks for asking it.
All display groups “batch” - in that they allow you to show perhaps 10 objects
at a time and maintain “forward” and “previous” page views.
I maintain that “ERXBatchingDisplayGroup” is poorly named and for your purposes
you should switch to “ERXDisplayGroup”
You see… the average display group fetches all objects into memory. If this is
5,000 records, no big deal. If this is a million records, might start to suck.
Regardless… the average display group fetches all objects but then shows a
handful at a time.
An “ERXBatchingDisplayGroup” is not an average display group. It is hiding a
“top n query”
You would use this “non average” display group when you want to give the feel
of random access to a rather large result set. You would do this because even
though it may represent 10 million records it only fetches about 100 of them at
any given time and then displays perhaps ten of them on the page. It is very
good with memory but you don’t have all the objects at your fingertips.
Cheers,
AARON ROSENZWEIG / Chat 'n Bike <http://www.chatnbike.com/>
e: email@hidden <mailto:email@hidden> t: (301) 956-2319
> On Oct 11, 2017, at 11:42 PM, Morris, Mark <email@hidden> wrote:
>
> Hi all,
>
> From some iffy experiences with them back in the WO 3.1 days, I’ve always
> avoided display groups, using my own batching/paging logic. But now I’m
> having issues with an existing ERXBatchingDisplayGroup, and I’m not sure
> what’s going on.
>
> displayedObjects() is working fine, and contains the records I expect.
> allObjects() however returns a FakeArray object, containing an equal number
> of NSKeyValueCoding.ErrorHandling placeholder objects as the total count I
> expect. I see some private and protected methods that look like they might
> force allObjects to update but nothing public, and I see that an
> EOEditingContext save or revert will probably also do the same. However, I
> don’t see how to just ask an ERXBatchingDisplayGroup for all of its objects,
> without changing the ec.
>
> Perhaps given the batching nature I shouldn’t be doing this, and instead I
> should just go back to the dg’s data source? Any thoughts or advice is
> welcome!
>
> Regards,
> Mark
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden