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 |