ColdFusion 8: CFWINDOW caches content
Posted At : June 5, 2007 5:54 AM
| Posted By : Dave
Related Categories:
ColdFusion
Well, I knew it would happen eventually. I knew it was only a matter of time that I would find a new feature of CF8 that would just tick me off. I finally found this in CFWINDOW. While the concept and intention is great I think that the implementation is crap.
First off lets start with the fact that it caches the content. If you call the window with a source it gets the source on first open. If the window is closed and then opened again the window does not get new content.
Next, if you want to load it based on a link using bind you have to use CFFORM. You can not just use an html form. By using CFFORM you add excessive bloat.
Resizing of the window is all messed up as well. You would think that when opening the window it would size and position itself based on the the settings. Well this is not the case 100% of the time. When the window is opened the size and positioning is based on how it was on last open. If it is the first open than every thing is fine. But if you open it, move it, change the size then close it on the next open it will look like it did when it was closed. Also, if you change the size of the browser the window will not recenter itself so it is possible you can loose it off the top of the browser.
If anything is corrected with this it should be the caching of the content. Everything else I could live but without better way to handle getting the source this tag is useless to me. I had tons of uses for CFWINDOW. However, I dont think that it was intended to be used in a dynamic environment.
--Dave

ColdFusion.navigate(url, 'cfWindowName_body');
ColdFusion.navigate(url, 'cfWindowName_title');
ColdFusion.Window.show(cfWindowName);
If you want variables from an HTML form just use the good old document.getElementById()
--Dave
A workaround? I'd call it an API.
PS - You should also be able to re-center, etc by using ColdFusion.Window.getWindowObject
Ok, so I redid what I was doing using all JS code and removed the CFWINDOW tag. I now get the functionality I was expecting. However, I still feel that the functionality should be consistent between the tag based and js based syntax. I should not have to use the JS syntax just to get the window to refresh its content.
<cfwindow source="myWindow.cfm?foo={myInput@keyup}" />
I know it bloats things a bit but it can be done I believe.
"Point taken, Dave. Do note that this is a Beta; the purpose of the Beta is to shake out bugs and problems in the implementation - we are looking for constructive feedback. I've filed an enhancement request filed to get windows to automatically reload when they're shown."
--Dave