.asc() = singular form, .ascs() = plural form, so ERXSortOrdering = one of them, singular ERXSortOrderings = plural, array subclass
ERXSortOrdering sortOrdering = Person.NAME.asc() ERXSortOrderings sortOrderingS = Person.NAME.ascs() you can also do: ERXSortOrderings sortOrderingS = Person.NAME().asc().array() ms On Dec 14, 2010, at 12:33 PM, Theodore Petrosky wrote: > One last item, > > > ERXSortOrderings is an mutablearray of EOSortOrderings, but the array cannot > have one item. > > ERXSortOrderings theCompanyOrder = ParentCompany.PARENT_COMPANY_NAME.asc(); > is not good. however, > > ERXSortOrdering theCompanyOrder = ParentCompany.PARENT_COMPANY_NAME.asc(); > NSArray<EOSortOrdering> companySort = new > NSArray<EOSortOrdering>(theCompanyOrder); > parentCompanyDG.setSortOrderings(companySort); > is good. > > obviously parentCompanyDG is an ERXDisplayGroup. > > > Is there a reason that I can not create an ERXSortOrderings with only one > item? > > Ted > > > > --- On Tue, 12/14/10, Mike Schrag <[email protected]> wrote: > >> From: Mike Schrag <[email protected]> >> Subject: Re: ERXSortOrderings ? >> To: "Theodore Petrosky" <[email protected]> >> Cc: [email protected] >> Date: Tuesday, December 14, 2010, 12:09 PM >> .asc() IS a sort ordering, you can't >> pass it to sortorderingwithkey because it's not a key >> it's a sort ordering. >> >> just get rid of ERXSortOrdering.sortOrderingWithKey >> entirely and use key.asc().then(whatever). >> >> ms >> >> On Dec 14, 2010, at 12:02 PM, Theodore Petrosky wrote: >> >>> Why does this work: >>> >>> ERXSortOrderings newOrdering = >> ERXSortOrdering.sortOrderingWithKey("parentCompany.parentCompanyName", >> ERXSortOrdering.CompareAscending).then(Client.CLIENT_NAME.asc()); >>> >>> but this doesn't: >>> >>> ERXSortOrderings newOrdering1 = >> ERXSortOrdering.sortOrderingWithKey(Client.PARENT_COMPANY.dot(ParentCompany.PARENT_COMPANY_NAME).asc()).then(Client.CLIENT_NAME.asc()); >>> >>> Here is the error: The method >> sortOrderingWithKey(String, NSSelector) in the type >> ERXSortOrdering is not applicable for the arguments >> (ERXSortOrdering.ERXSortOrderings) >>> >>> ERXSortOrderings newOrdering2 = >> ERXSortOrdering.sortOrderingWithKey(Client.PARENT_COMPANY.dot(ParentCompany.PARENT_COMPANY_NAME).asc()).then(Client.CLIENT_NAME.asc()); >>> >>> ERXSortOrderings newOrdering2 = >> ERXSortOrdering.sortOrderingWithKey(ParentCompany.PARENT_COMPANY_NAME.asc().then(Client.CLIENT_NAME.asc()); >>> >>> As long as I start out with "string, selector" then I >> can chain - then, then, etc. >>> >>> I must have some deep seated misunderstanding of >> ERXSortOrderings and how to create it. >>> >>> this one works beautifully: (except on closer >> examination, I don't understand why it works with the >> parenthesis around the first element) >>> >>> ERXSortOrderings newOrdering = >> ERXSortOrdering.sortOrderingWithKey("version.job.primaryKey", >> ERXSortOrdering.CompareAscending) >>> >> .then(Invoice.VERSION.dot(Version.ITEM_INDEX).asc()) >>> >> .then(Invoice.VERSION.dot(Version.SUB_VERSION_NUMBER).asc()) >>> >> .then(Invoice.VERSION.dot(Version.REVISION_NUMBER).asc()) >>> >> .then(Invoice.INVOICE_DATE.asc() ); >>> >>> >>> Ted >>> > > > > _______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [email protected]
