Re: Sorting Relationed Records
Re: Sorting Relationed Records
- Subject: Re: Sorting Relationed Records
- From: "A. Uchida" <email@hidden>
- Date: Wed, 21 Jul 2004 22:34:23 +0100
Thanks for your comment.
I tried it in my code but any attributes get NullPointerException.
This might mean the values are not successfully passed.
But when I disabled the System.out.println ...... from my code
all the proper recodes are shown in the next page.
What I used for passing the records are nextPage.setAKeyOfEntity(aKey)
method in the previous page, which WebObject Builder automatically
generated,
just before calling the nextPage.
How should I pass the records to allow sorting?
Thanks in advance for your help.
On 21 Jul 2004, at 18:44, Nathan Dumar wrote:
I suspect that the value was not successfully passed for some reason.
Make sure you have really passed the value to the next page (make sure
the page's variable is not null).
On the next page, before trying anything else, try:
System.out.println(thePassedObject.anyAttribute());
Nathan
On Jul 20, 2004, at 8:11 PM, A. Uchida wrote:
Posted again, because the original message didn't have subject.
Hi there,
I am doing a practice of WO application using MacOSX 10.3, Xcode and
WO5.2.
I've faced a problem of EOSortOrdering and can't work out by myself.
From a previous list view page (Fetch by WODisplayGroup) and pass a
record
to a next page. The record (EntityA) has to-many relationship to
EntityB.
My part of the code is as follows.
Whatever I tried at this moment, " java.lang.NullPointerException" at
the first line of the following codes. (aKeyOfEntityA.relations()
doesn't return any records)
In the next page, there is no WODisplayGroup. I used to bind
aKeyOfEntityA.relations to
the list of WORepetition and this shows a list of related EntityB
records.
Any help would be very much appreciated.
NSArray anArray = new NSArray(aKeyOfEntityA.relations());
EOSortOrdering so1 = EOSortOrdering.sortOrderingWithKey("ep_date",
EOSortOrdering.CompareAscending);
EOSortOrdering so2 =EOSortOrdering.sortOrderingWithKey("ep_Category",
EOSortOrdering.CompareAscending);
NSArray soList = new NSArray(new Object[]{so1, so2});
sortResult = EOSortOrdering.sortedArrayUsingKeyOrderArray(anArray,
soList);
A. Uchida
_______________________________________________
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.
_______________________________________________
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.