Re: WODisplayGroup + qualifyDisplayGroup() + mutators = FAIL
Re: WODisplayGroup + qualifyDisplayGroup() + mutators = FAIL
- Subject: Re: WODisplayGroup + qualifyDisplayGroup() + mutators = FAIL
- From: Q <email@hidden>
- Date: Thu, 28 Aug 2008 08:46:39 +1000
On 27/08/2008, at 11:05 PM, Owen McKerrow wrote:
On 27/08/2008, at 2:19 PM, Q wrote:
Has anyone else noticed that if you use qualifyDisplayGroup() on a
WODisplayGroup to restrict displayedObjects() with a qualifier and
then try to use insertNewObjectAtIndex, indexOfLastDisplayedObject
or insertObjectAtIndex, they are all broken because the
displayedObjects and allObjects arrays are no longer the same size.
Hmmm it may just be that its late at night, but aren't
displayedObjects and allObjects almost always different in size ? I
mean isn't that the point of having teh two of them, you have 30
objects in the all array of which you want to show 10 ( the display
array).
Anyways doesn't help at all with your bug, but just curious as to
what it was you meant. Is it that you have qualified the displayed
objects so its now say 8 objects instead of 10, which would stuff up
your batching as the batching is based of the allObjects array ?
Actually batching is based on an internal displayedObjects array
inside wodisplaygroup, but the problem I am referring to is not really
related to batching.
When I said displayedObjects and allObjects are different sizes I
meant independently of the batch size they contain a different number
of total objects. Internally WODisplayGroup maintains two arrays of
objects, which when qualified become different sizes.
Ok, here is a quick rundown of the problem.
Say you have 50 objects in your display group and a batch size of 25.
If you qualify it with a qualifier so that displayedObjects() return
no objects and call indexOfLastDisplayedObject it will return 25
instead of 0. If you set the batch size to 0 it will return 50 instead
of 0. It's not using displayedObjects at all but allObjects to
calculate the index value which is not what the documentations (or
them method name) says it is doing (using jad confirms this).
If you try and use insertObjectAtIndex or insertObjectAtNewIndex it
will fail to insert the object into allObjects for any index other
than 0 because of an out of bounds issue with displayedObjects
despite the documentation saying that the object will be inserted at
the index position into allobjects and displayedobject "if possible"..
That may be a matter of interpretation, but it's pretty useless so say
"if possible" if it really means "only when possible for both arrays".
--
Seeya...Q
Quinton Dolan - email@hidden
Gold Coast, QLD, Australia (GMT+10)
Ph: +61 419 729 806
_______________________________________________
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