Hey Spike,

why did I not think of that, append is a much cleaner way of doing it! I'll have to 
give that one a go and see if it works (it should in theory).

I did do a dump before and it was empty, as I said the funny thing is it always seemed 
to work before, and I guess I just want to get an idea whether it is something that 
should have never worked, stopped working or should now work etc.

Cheers.


-----Original Message-----
From: Stephen Milligan [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 2 June 2004 9:05 AM
To: CFAussie Mailing List
Subject: [cfaussie] RE: Form scope weirdness or ........


I think the problem is that you are actually creating a Variables scoped
variable called Form when you do:
Form = structNew()
Form = duplicate(session.process.form)

Just to test, try dumping the variables scope after running that code.

Since the form scope is part of the automatic discovery process all sorts of
weirdness could ensue from that.


This should work the way you expect it to:
structClear(Form)
structAppend(Form,session.process.form)

Spike

--------------------------------------------
Stephen Milligan
Code poet for hire
http://www.spike.org.uk

Do you cfeclipse? http://cfeclipse.tigris.org




>-----Original Message-----
>From: [EMAIL PROTECTED]
>[mailto:[EMAIL PROTECTED] On Behalf Of
>Taco Fleur
>Sent: Tuesday, June 01, 2004 2:55 PM
>To: CFAussie Mailing List
>Subject: [cfaussie] RE: Form scope weirdness or ........
>
>Hi Steve,
>
>I realize I do not need to copy the structure back to where it
>originated from, however many years of development will show
>you that it is definitely a good practise, and will help to
>keep your code clean.
>
>
>
>       -----Original Message-----
>       From: Clifton Steve [mailto:[EMAIL PROTECTED]
>       Sent: Wednesday, 2 June 2004 8:28 AM
>       To: CFAussie Mailing List
>       Subject: [cfaussie] RE: Form scope weirdness or ........
>
>
>       1. just because it originates in the form scope, it
>doesn't mean you have to copy it back to form scope to use variables.
>       
>       2. you would just do something like <input type="text"
>name="thisTest" <cfif
>isdefined("session.process.form.thisTest")>value="#session.proc
ess.form.thisTest#"</cfif>>
>       
>       taco, it's not that i am consciously storing form scope
>in the request, it's just that any session scope i copy into
>the request scope in my Application.cfm (using a CFLOCK) and
>then copy back to the session scope in OnRequestEnd.cfm (also
>using CFLOCK)... this is a CF5 best practice that i have
>maintained in CFMX. It just means that on any template in my
>application i can change any of the request.session scope
>variables without worrying about CFLOCK.
>       
>       steve
>       
>
>               -----Original Message-----
>               From: [EMAIL PROTECTED]
>[mailto:[EMAIL PROTECTED] On Behalf Of
>Taco Fleur
>               Sent: Wednesday, 2 June 2004 8:11 AM
>               To: CFAussie Mailing List
>               Subject: [cfaussie] RE: Form scope weirdness or ........
>       
>       
>               Steve,
>               
>               I copy the stored form scope back to the FORM scope:
>               1. because it was data in the form scope
>               2. because I do not want to start writing
>things like <cfset form.thisTest =
>session.process.form.thisTest><input type="text"
>name="thisTest" value="#form.thisTest#">
>               3. etc.
>               
>               I don't understand why you store the form scope
>in the request? its not persistent, unless you keep using
>server-side redirects.
>               
>               Anyone else care to comment on my issue, is
>nobody storing the form scope like I do?
>
>                       -----Original Message-----
>                       From: Clifton Steve
>[mailto:[EMAIL PROTECTED]
>                       Sent: Wednesday, 2 June 2004 8:02 AM
>                       To: CFAussie Mailing List
>                       Subject: [cfaussie] RE: Form scope
>weirdness or ........
>               
>               
>                       taco,
>                       
>                       not sure why you need to copy the
>session structure back to the form scope?
>                       
>                       i usually just do this on the action page:
>                       
>                       <CFIF NOT
>IsDefined("Request.Session.online.fieldnames")>
>                       <CFSET Request.Session.online = StructNew()>
>                       </CFIF>
>                       <cfset
>StructAppend(request.session.online,form)>
>                       
>                       and continue to use the request
>structure until the end of the process (insert/update a db or
>send an email etc.) when i clear it:
>                       
>                       <CFSET StructClear(request.session.online)>
>                       
>                       steve
>                       
>                       -----Original Message-----
>                       From:
>[EMAIL PROTECTED]
>[mailto:[EMAIL PROTECTED] On Behalf Of
>Taco Fleur
>                       Sent: Tuesday, 1 June 2004 4:10 PM
>                       To: CFAussie Mailing List
>                       Subject: [cfaussie] Form scope
>weirdness or ........
>               
>               
>
>                               When I have a multi form
>process I usually store the form structure in the session, i.e.
>
>                               session.process.form = duplicate(form);
>
>                               or structAppend when it needs
>to append the form structure
>
>                               at the end of the process I do
>                               form = structNew();
>                               form =
>duplicate(session.process.form); (copying the saved structure
>back tot he form scope)
>
>                               I find that sometimes it just
>does not work (when trying to show this code to someone else
>for example) its driving me nuts, either what I am doing just
>is no good and should have never worked for me either, or I am
>just missing the obvious today.
>
>                               The problem I am having is that
>the FORM scope is empty when I dump it after trying to copy
>the stored structure back to the form scope.
>
>                               anyone care to comment? Anyone
>else doing this?
>
>                               Cheers,
>                               Taco
>
>                               ---
>                               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 Register now for the 3rd National Conference on
>Tourism Futures, being held in Townsville, North Queensland
>4-7 August - www.tq.com.au/tfconf
>
>
>                       ---
>                       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
>Register now for the 3rd National Conference on Tourism
>Futures, being held in Townsville, North Queensland 4-7 August
>- www.tq.com.au/tfconf
>
>
>       ---
>       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
>Register now for the 3rd National Conference on Tourism
>Futures, being held in Townsville, North Queensland 4-7 August
>- www.tq.com.au/tfconf
>
>


---
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

Register now for the 3rd National Conference on Tourism Futures, being held in 
Townsville, North Queensland 4-7 August - www.tq.com.au/tfconf

---
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

Reply via email to