Coldfusion CFWINDOW Refresh Problem

I ran into this while working on a client project the other day and thought I’d share. With building a whole front end administration for certain users via several dynamic CFWINDOWS. However, if the users were submitting a form (or clicking Ajax Links) in the CFWINDOW, then closing it. When they reopened it, it was [...]

I ran into this while working on a client project the other day and thought I’d share. With building a whole front end administration for certain users via several dynamic CFWINDOWS. However, if the users were submitting a form (or clicking Ajax Links) in the CFWINDOW, then closing it. When they reopened it, it was not reloading to the correct page. Here’s how to fix it:

Normally you would have something like this:


title="Title of Window Here" source="/pathto/file.cfm" width="660"
height="600" center="true" modal="true" resizable="false"
 draggable="false" initshow="false" />

That’s going to work well and good, but you’ll run into issues where it won’t refresh, so instead add the: refreshOnShow=”true” attribute to the CFWINDOW. Why this isn’t set to true as the default is beyond me, but at least we have the option to set it.

Fixed, Refreshing version:


source="/pathto/file.cfm" width="660" height="600"
center="true" modal="true" resizable="false" draggable="false"
initshow="false" refreshonshow="true" />