Thanks..... its great when the answer is simple and in front of my nose.
Ted - > ------------------------------ > > Message: 2 > Date: Thu, 2 Aug 2007 10:44:07 -0400 > From: Ken Anderson <[EMAIL PROTECTED]> > Subject: Re: first time relationship problem > To: Theodore Petrosky <[EMAIL PROTECTED]> > Cc: [email protected] > Message-ID: > <[EMAIL PROTECTED]> > Content-Type: text/plain; charset=US-ASCII; > delsp=yes; format=flowed > > You saved the changes, therefore delete > 'theSection', but then you > tried to access 'theSection'. You should move the > removeObject... > line to above the deleteObject line. > > On Aug 2, 2007, at 10:40 AM, Theodore Petrosky > wrote: > > > I am relatively new to WO.. I finally put together > a > > web application (internal to the company) that is > not > > very big. > > > > I am using the examples in the Marker book to > create a > > to-many relationship. (publications have > sections). I > > > > I just implemented a removeSection action with > this > > code: > > > > public WOComponent deleteSection() { > > // System.out.println("deleting a row!"); > > > > > > > session().defaultEditingContext().deleteObject(theSection); > > session().defaultEditingContext().saveChanges(); > > > > > publication.removeObjectFromBothSidesOfRelationshipWithKey(theSection, > > "sectionss"); > > return null; > > } > > > > everything is fine so far.. except if I try to add > a > > new section object. my app crashes. > > > > this is the top of the error log: > > > > java.lang.IllegalStateException: Cannot obtain > > globalId for an object which is not registered in > any > > editingContextobject: {values = {sectiontrim = ; > > sectioncomment = ; sectiontitle = "aaaaaa"; > > sectionbleed = ; sectionsafety = ; }; this = ""; > }, > > databaseContext: > > [EMAIL PROTECTED], > > object's editingContext: null, databaseContext's > > active editingContext: > > [EMAIL PROTECTED] > > > > > > Should I be 'clearing' the editingContext? What am > I > > missing in the logic of WebObjects? > > > > Ted > > ____________________________________________________________________________________ Sick sense of humor? Visit Yahoo! TV's Comedy with an Edge to see what's on, when. http://tv.yahoo.com/collections/222 _______________________________________________ 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]
