FYI, Since the update that added the event model support I’ve been known to put a particular record in the session scope when editing it.  This makes it nicer to work with when you have a hierarchy of objects or stateful data you’re trying to persist.  IE a new address added to a user. 

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Marcus Cox
Sent: Sunday, February 05, 2006 11:43 PM
To: [email protected]
Subject: Re: Reactor For CF Newbie question..saving content from a form

 

Sean Corfield wrote:

On 2/5/06, M.C. <[EMAIL PROTECTED]> wrote:
  

Question? Since the frmPage doesn't post back to itself, how do I save
the page record? Do I have to create the page record again and then save
like below or is there a better way?
    
 
Even if the form did post back to itself you'd have to create the
record again - you create it and store it in variables scope which
gets recreated with each page request. It's a small overhead so I
wouldn't worry about it.
 
If you really find it to be performance critical then you could always
store the record in session scope instead of variables scope...
--
Sean A Corfield -- http://corfield.org/
Got frameworks?
 
"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood
 
 
  

Thanks Sean,
Just wanted to make sure this was the correct way to go. After digging around further, I saw that I could do it all in one line of code:
<cfset PageRecord = application.Reactor.createRecord("Pages").load(PageID=#vars.PageID#)>
Nice!
---Marcus Cox

-- Reactor for ColdFusion Mailing List -- [email protected] -- Archives at http://www.mail-archive.com/reactor%40doughughes.net/

Reply via email to