Re: WODisplayGroup.displayableObjects()?
Re: WODisplayGroup.displayableObjects()?
- Subject: Re: WODisplayGroup.displayableObjects()?
- From: Art Isbell <email@hidden>
- Date: Thu, 3 Jul 2003 13:55:51 -1000
On Thursday, July 3, 2003, at 12:57 PM, John Boynton wrote:
Is there a way to get an array of displayable objects from a
WODisplayGroup? This would be the subset of allObjects() after an
in-memory qualifier has been applied. I'm using a display group to show
batches of results, and would like to be able to say "showing items X
through Y of Z", where Z is the total number of items that would be
displayed if the user navigates through all of the batches.
Unfortunately,
displayedObjects() gives only those items in the current batch. I don't
see a way to get the count of items of all displayable objects. Is
there?
WOBatchNavigationBar, a dynamic element whose source is included in
the installed developer examples, displays the count of all objects
being batched. It uses allObjects().count(). Hmm, that doesn't seem
correct if a local qualifier has been set on the WODisplayGroup, so
maybe this is a bug.
I think you could define a method that returns the count you want by
filtering allObjects() by qualifier():
int count =
EOQualifier.filteredArrayWithQualifier(displayGroup.allObjects(),
displayGroup.qualifier()).count();
Unfortunately, doing the above means that the filtering would be
repeated, once in your method and once when the display group is
creating its displayed objects array. You might be able to avoid this
by not setting a local qualifier on the display group. Instead in your
code, you would send the displayGroup an allObjects() message prior to
displaying the objects. You would then apply the local qualifier
programmatically, get the count of the resulting array, and send the
display group a setObjectArray() message with this filtered array as an
argument followed by an updateDisplayedObjects() message which should
apply any sort orderings and batching.
Aloha,
Art
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.