barry >From memory, cflocation uses headers to to the redirect, thus you loose all your server vars including your form scope
getPageContext().forward(thispage & "?action=addnew"); does it serverside basically telling the server to, when its done processing, to do to that page rather than the page defined in the original headers, so your not actually leaving the cf servers environment in this case, thus holding onto your form scope. you may have to clear the form scope before you call the redirect, or write a little CFFUNCTION that calls the getPageContext.... so you can still call a redirect from your cfscript Steve -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Barry Beattie Sent: Tuesday, April 27, 2004 4:39 PM To: CFAussie Mailing List Subject: [cfaussie] getPageContext().forward() wierdness Hi all I'm using this in CFScript: getPageContext().forward(thispage & "?action=addnew"); to reload the page after a save for a new form display. Trouble is that it, with the logic I'm using (below), it seems to want to go around again, like the FORM scope persists. Going back to CFLOCATION works fine. Can this happen? Because this is a server-side re-direct (reload the target page), can the FORM scope still persist after getPageContext is called? the main page processing logicw when the form submitted <cfscript> objRequisition = createobject("component", "XXX").init(dsnInfo, cmpy); if (isDefined("form.fieldnames")){ if (isNew){ // NEW setObjPropertiesFromForm(objRequisition); objRequisition.AddNew(); }else if(isEdit){ // EDIT setObjPropertiesFromForm(objRequisition); objRequisition.Update(); }else{ abort(); } getPageContext().forward(thispage & "?action=addnew"); // reload this page for a new requisition }else{ if (isNew){ // new requisition fillFormFromDefaults(); }else if(isEdit){ // from link objRequisition.get(URL.req); fillFormFromObject(objRequisition); }else{ abort(); } } </cfscript> --- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia http://www.mxdu.com/ + 24-25 February, 2004 --- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia http://www.mxdu.com/ + 24-25 February, 2004
