Re: first time relationship problem
Re: first time relationship problem
- Subject: Re: first time relationship problem
- From: Theodore Petrosky <email@hidden>
- Date: Thu, 2 Aug 2007 10:01:01 -0700 (PDT)
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@hidden>
> Subject: Re: first time relationship problem
> To: Theodore Petrosky <email@hidden>
> Cc: email@hidden
> Message-ID:
> <email@hidden>
> 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:
> > com.webobjects.eoaccess.EODatabaseContext@e36ec6,
> > object's editingContext: null, databaseContext's
> > active editingContext:
> > com.webobjects.eocontrol.EOEditingContext@f68336
> >
> >
> > 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@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden