I have an ecommerce site. I have terms and conditions/disclaimer info that I put in a cfwindow tag. The cfwindow is hidden initially and I open it with coldfusion.window.show. Everything works just fine. The problem occurs when I close the window. It closes just fine with the 'X' in the upper right corner, but I also built a button to close it using coldfusion.window.hide. When this is clicked, it closes the window, puts x and y variables in the url and clears the form struct. I have some form variables displaying on the page. So the net result is that when the cfwindow is closed, the page refreshes and some info is missing from the page that comes from the form. Anyone else run into this?
I don't see how those actions you describe (which all happen on the client side) can affect the form scope, which is on the server. Especially givn By the time any of that code is on the client machine and running, the form scope is already long dead (as is everything else to do with generating the response that gets sent to the client browser an then executed.
Are you sure you're identifying what the problem (and the sequence of events leading up to the problem) actually is?
Here is the exact flow...I get to my confirm page which has a link where I am using coldfusion.window.show to display a disclaimer. This works fine. The checkout page displays form variables from the previous step in the checkout process. When I click on a button within my cfwindow that uses coldfusion.window.hide, the window closes and the screen refreshes and my form struct is empty.
... the screen refreshes and my form struct is empty
FORM data does not persist across multiple requests. So depending on what you mean by "refresh" it is entirely possible the FORM scope will be (and should be) empty after you refresh the screen.
To combine both Adam's and cfsearching's answer.
The form scope only exists during the response built by ColdFusion when the form request was received. As soon as that response is finished and sent to the web server to be forwarded back to the client browser, ColdFusion has thrown out the form scope and moved on to a completely new request (or is waiting for a new request).
Any future requests from the original client, either Ajax requests from cfwindow wizardry, or refreshes of the whole page will not have access to that previous form request, unless you do something yourself to repeat the form header information in this new request.