ColdFusion.Window (onHide - destroy)
Hello All, I have what seems like a simple need.
NEED: To destroy a window when it's closed.(so that any subsiquent opening of that window will have fresh content)
The window is created using ColdFusion.Window.create
1) I'd assume that"refreshOnShow:true" argument would FORCE this to happen when the window goes form hidden to shown... but alas - this does NOT seem to happen.
2) so now i think I need to force the window to be destroyed when it is hidden....removing it from memory.
The problem I'm having is that - according to the CF DEBUGGER - IT LOOKS like the onHide function is executing BEFORE the create function
--- here is the debug screen ---
window:global: uncaught exception: ColdFusion.Window.onHide: Window not found, id: My_Report (, line 0)
error:http: ColdFusion.Window.onHide: Window not found, id: My_Report
info:widget: Window shown, id: WIN_Report
--- end debug ---
Here is my code...Clearly, the create and show functions are 'coded' BEFORE the onHide...and should (in my mind) be created by the time the onHide line gets parsed....
--- my code ---
// REPORT CONFIG
var DRconfig = {
height:650,width:1120,center:true,refreshOnShow:true,modal:true,closable:true,draggable:true,initshow:false,resizable:false
}
// CREATE AND SHOW REPORT WINDOW
function popupReport() {
ColdFusion.Window.create('My_Report', 'My Report', 'reports/myreport.cfm', DRconfig);
ColdFusion.Window.show('My_Report');
ColdFusion.Window.onHide('My_Report',destroyWIN('My_Report'));
}
// DESTROY THE WINDOW
function destroyWIN(x) {
ColdFusion.Window.destroy(x,true)
}
---
THank for helping...
If someone has a BETTER way of achieving my needs - please share.
