Re: Simple Web forms to create an EO object
Re: Simple Web forms to create an EO object
- Subject: Re: Simple Web forms to create an EO object
- From: Amorya North <email@hidden>
- Date: Wed, 4 Aug 2004 16:41:33 +0100
On 4 Aug 2004, at 4:03 pm, Nathan Dumar wrote:
> No worries with method 1, as long as you're not using the
> defaultEditingContext.
>
> If you're creating the record when the page opens, then create a new
> ec (myEC, for example) just before creating the new record, and insert
> the record into myEC. The record will not be permanently added until
> you explicitly do myEC.saveChanges(). If the user doesn't save, but
> instead goes to a different page or site, WO will throw away myEC and
> all of its contents (the inserted, blank record) when it throws away
> the cache of the page (automatically done).
Just been looking through Apple's examples... in one, they create an EO
object as the page is created, but don't insert it into any editing
context! They do the insertion when the Save button is pressed. (At
least, I think that's what happens from reading the code).
I thought this was a bad idea. Someone told me once in no uncertain
terms that you should never have an Enterprise Object that wasn't in
the database.
Any thoughts?
Amorya
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.