Re: Display Group not setting object array
Re: Display Group not setting object array
- Subject: Re: Display Group not setting object array
- From: Thomas <email@hidden>
- Date: Mon, 7 Feb 2005 17:30:27 +1100
Folks,
thanks for the help, but that didn't solve the problem. Note that the 3
displayed objects are from the ORIGINAL object array, not from the new
one.
Here's some really paranoid code:
System.out.println("Setting real foundUsers = " + n.count());
//usersDisplayGroup.setNumberOfObjectsPerBatch(0);
usersDisplayGroup.setObjectArray(n);
//usersDisplayGroup.setNumberOfObjectsPerBatch(20);
usersDisplayGroup.setCurrentBatchIndex(1);
//usersDisplayGroup.selectObject(n.objectAtIndex(0));
//usersDisplayGroup.displayBatchContainingSelectedObject();
usersDisplayGroup.updateDisplayedObjects();
System.out.println("usersDisplayGroup.displayedObjects = " +
usersDisplayGroup.displayedObjects().count());
System.out.println("usersDisplayGroup.allObjects = " +
usersDisplayGroup.allObjects().count());
System.out.println(" batch index = " +
usersDisplayGroup.currentBatchIndex() +
", batch size = " + usersDisplayGroup.numberOfObjectsPerBatch());
Here's the result, with or without any of the commented lines above:
Setting real foundUsers = 9
usersDisplayGroup.displayedObjects = 3
usersDisplayGroup.allObjects = 9
batch index = 1, batch size = 20
On 07/02/2005, at 15:45, Owen McKerrow wrote:
Hi Thomas,
displayedObjects is an array of the current batch that you are
showing. So while n has a count of 9, your displayedObjects has a
count of 3, and Im assuming 3 will be the size you have set your
batches to.
What you should be printing out is the count of allObjects() which is
the array that get set when you call setObjectArray(n).
So the code should be ( this incorporates Mark Edward's suggestion )
System.out.println("Setting real foundUsers = " + n.count());
usersDisplayGroup.setObjectArray(n);
usersDisplayGroup.setCurrentBatch(1);
usersDisplayGroup.updateDisplayedObjects();
System.out.println("usersDisplayGroup.allObjects = " +
usersDisplayGroup.allObjects().count());
On 07/02/2005, at 3:21 PM, Thomas wrote:
I'm using a Display Group for its batch display capabilities, and I'm
setting the object array, which works the first time. But when I set
it to something different, using this code, I get strange results,
with none of the new objects being shown. The code is:
System.out.println("Setting real foundUsers = " + n.count());
usersDisplayGroup.setObjectArray(n);
usersDisplayGroup.updateDisplayedObjects();
System.out.println("usersDisplayGroup.displayedObjects = " +
usersDisplayGroup.displayedObjects().count());
Gives this result:
Setting real foundUsers = 9
usersDisplayGroup.displayedObjects = 3
The displayed objects are the first few of the old list, but the
number doesn't match the new list or the old list.
Any ideas?
_______________________________________________
_______________________________________________
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