Re: "Saving" changes to an object's variable(s) but not save changes to database.

"Jerry W. Walker" <[email protected]>
Newsgroups gmane.comp.web.webobjects.devel
Message-ID <[email protected]>
Hi, Tony,

I would suggest defining in your Session your NSMutableArray into  
which you fetch the EOs and always referencing it from your Session.  
WOBuilder has a Session reference in its browser which gives you a  
very convenient method of binding your Session array of EOs to your  
WOTextFields. When the user hits the submit button, the form values  
are automatically pushed into the array of EOs, so they will have  
been updated with no further effort on your part.

Since these are EOs that you have fetched from the DB, they have  
global IDs and can be passed from editing context to editing context,  
but unless you're using your Session's default editing context for  
something else during this interaction, you can just use it to fetch  
the original values.

Regards,
Jerry


On Aug 29, 2006, at 10:54 PM, Tony Hoffman wrote:

> I have what may be such a profoundly stupid question that it may  
> need to be ignored by all. I've gone through my books and the list  
> and Google searches and I still can't find anything that gets me  
> even close to the answer (also usually a big tip off that my  
> question/and or thinking is deeply misguided).
>
> My problem is basically this: I want users of my web application to  
> be able to make form input changes into the variable value of each  
> instance of an object generated from an EOFetchspecification. And  
> then I want to be able to save these values in the session so that  
> I can move it between components, refer to it, and then have it  
> disappear at the end of the session without ever bothering the  
> database again. If I were to use the saveChanges method on the  
> editingcontext for this NSMutableArray of objects and its input  
> variables, everything works fine, but I don't want to save changes  
> to the database, I want to save changes to the (temporary) values  
> in the variable in the objects held in the session.
>
> I have the WOTextFields just sitting there. All I want to do is  
> link them up with some kind of action method that will record the  
> user input into the object variables in the session WITHOUT saving  
> those changes to the database. It seems so basic that I have to  
> ask, what am I missing?
> _______________________________________________
> WebObjects-dev mailing list
> [email protected]
> http://www.omnigroup.com/mailman/listinfo/webobjects-dev


--
__ Jerry W. Walker,
    WebObjects Developer/Instructor for High Performance Industrial  
Strength Internet Enabled Systems

     [email protected]
     203 278-4085        office
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.