Skip navigation
Currently Being Moderated

Coldfusion.window.hide clearing form struct

May 18, 2010 10:57 PM

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?

 
Replies
  • Currently Being Moderated
    May 18, 2010 11:56 PM   in reply to Clay Hess

    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?

     

    --

    Adam

     
    |
    Mark as:
  • Currently Being Moderated
    May 24, 2010 1:25 PM   in reply to Clay Hess

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

     
    |
    Mark as:
  • Currently Being Moderated
    May 24, 2010 1:35 PM   in reply to Clay Hess

    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.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points