Thanks for the replies. I can see how that works now.

With best regards,

.neilmac


On 13 May 2011, at 17:16, Ramsey Gurley wrote:

> It sounds like you're marking the tickets as 'selected' on the ticket object. 
> If that is the case, the array's hold a pointer to the original object and 
> that information is shared between them all.
> 
> Ramsey

On 13 May 2011, at 18:12, Chuck Hill wrote:

> There is only one object per EO per editing context.  The arrays below only 
> contain references to that one, true EO.  They don't contain the actual EO 
> and EOQualifier.filteredArrayWithQualifier is not copying EOs, it is copying 
> references (i.e. pointers).
> 
> Chuck
> 


> On May 13, 2011, at 2:40 AM, Neil MacLennan wrote:
> 
>> public NSArray<Product> tickets;
>> public NSArray<Product> tickets_weekend;
>> public NSArray<Product> tickets_day;
>> public NSArray<Product> tickets_evening;
>> 
>> tickets = Product.fetchAllTicketProducts(ec);
>>              
>> EOKeyValueQualifier qual1 = new EOKeyValueQualifier(Product.CATEGORY_KEY, 
>> EOQualifier.QualifierOperatorEqual, "WEEKEND");
>> EOKeyValueQualifier qual2 = new EOKeyValueQualifier(Product.CATEGORY_KEY, 
>> EOQualifier.QualifierOperatorEqual, "DAY");
>> EOKeyValueQualifier qual3 = new EOKeyValueQualifier(Product.CATEGORY_KEY, 
>> EOQualifier.QualifierOperatorEqual, "EVENING");
>> tickets_weekend = EOQualifier.filteredArrayWithQualifier(tickets, qual1);
>> tickets_day     = EOQualifier.filteredArrayWithQualifier(tickets, qual2);
>> tickets_evening = EOQualifier.filteredArrayWithQualifier(tickets, qual3);
>> 
>> 
>> I've a question about EOs that I obviously haven't quite got right in my 
>> head.
>> 
>> I have a Product EO that I load from the database and filter into three 
>> categories for display/grouping purposes on-screen. I filter these into 
>> three new arrays. [This may or may not be the best way to do what I want to 
>> do here, but in any case my question is still puzzling for me]
>> 
>> When my page returns after a submission, I can find all the 
>> customer-selections in the original *tickets* NSArray as well as 
>> individually in each of the new, filtered arrays.
>> 
>> As it happens this my desired behaviour, just not my expected behaviour. 
>> It's great have all my selected products in the one *tickets* EO that I can 
>> work with in my cart.
>> 
>> My question is, though, why was the original *tickets* array updated when my 
>> page returned? The *tickets* array didn't feature anywhere in the 
>> WOComponent for that page. There's clearly something about the object 
>> references between the original array and the new, filtered, arrays that I'm 
>> not quite grasping.
>> 
>> .neilmac
>> _______________________________________________
>> 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/chill%40global-village.net
>> 
>> This email sent to [email protected]
> 
> -- 
> Chuck Hill             Senior Consultant / VP Development
> 
> Come to WOWODC this July for unparalleled WO learning opportunities and real 
> peer to peer problem solving!  Network, socialize, and enjoy a great 
> cosmopolitan city.  See you there!  http://www.wocommunity.org/wowodc11/
> 

--
Neil MacLennan
Sanctus Media Ltd
e:  [email protected]
o:  01506 827217
m: 07710 752222

+++++
We're delighted to announce the publication of "Cross Shaped Space" — A Book of 
Prayers. If you've enjoyed the prayers here on Sanctuary First, we have 
published a selection from the last few years in this new book. Price £7.99. 

http://www.sanctusmedia.com/shop/cross-shaped-space.html

 _______________________________________________
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]

Reply via email to