Re: EOF objects and NON NULL validation

Mark Morris <[email protected]> Thu, 06 Nov 2003 15:16:16 -0600
Newsgroups gmane.comp.web.webobjects.eof
Message-ID <[email protected]>
Hello!  Because of the way you want to organize the display, it's not hard, but not as trivial as it usually is. ;-)

Given anInvoice, I would explicitly fetch from your Project table using something like this:

 invoiceProjects = EOUtilities.objectsWithQualiferFormat(
     session().defaultEditingContext(),
     "Project",
     "timecard.invoice=%@",
     new NSArray( anInvoice )
 );

You could then use invoiceProjects as the list of your outer WORepetition (with something like aProject for the item), and aProject.timecards() as your list for the inner WORepetition.

Of course, depending on your data, there's no guarantee that all the timecards for a project are in the same invoice. If not, and if this matters, you can filter the timecard array using EOQualifier.qualifierWithQualifierFormat and EOQualifier.filteredArrayWithQualifier.

Hope this helps. :-)

Regards,
Mark Morris


On Thursday, November 06, 2003, at 02:40PM, Ric Turley <[email protected]> wrote:

>I am trying to recreate invoices originally created in a FMP database in
>WebObjects. The model relates timecards to invoices and to projects like
>this:
>
>    invoice <-->> timecard <<--> project
>
>The invoice needs to look like:
>
>    Invoice info
>        Project info
>            1st Timecard for Project
>            next Timecard for Project
>            next Timecard for Project
>        Project info
>            only Timecard for Project
>        Project info
>            1st Timecard for Project
>            next Timecard for Project
>
>In WO, I am using 2 repetitions to display the data.  What is the best way
>to organize the entities by invoice, then project and then timecard.  It
>seems like this should be easy, but I just can't get there.
>
>Thanks, 
>Ric Turley
>Zarac Software
>Custom Software Development
>http://www.zarac.com
>Office: (303) 642-3106
>
>
>_______________________________________________
>EOF mailing list
>[email protected]
>http://www.omnigroup.com/mailman/listinfo/eof
>
>