For anyone else who wants to do this, I got it working finally. But it required
the use of a try catch block to ignore the exception caused when you try to
ColdFusion.Window.getWindowObject(x) on a window that may or may not exist. I
was unable to find an elegant method to check if a window exists by name. Also,
I had to create a dedicated event-handler for each window, because if they all
fire the same event, no identifiable information seems to be be passed with the
window (most notably, the name).
So the code (which is invoked via AjaxOnLoad()) is clunky, but works and looks
like this:
moveListener = function()
{
if (ColdFusion.Window != null)
{
try {
var w = ColdFusion.Window.getWindowObject('todayAtWindow');
w.on('move',setCoordsTODAYAT,w);
w.on('hide',closeWindowTODAYAT,w);
} catch (e) {
// ignore it
}
try {
var w = ColdFusion.Window.getWindowObject('searcher');
w.on('move',setCoordsSEARCHER,w);
w.on('hide',closeWindowSEARCHER,w);
} catch (e) {
// ignore it
}
}
}
setCoordsTODAYAT = function(ob,x,y)
{
Set_Cookie('TODAYATWINDOW_X', x, 10, '/', '', '');
Set_Cookie('TODAYATWINDOW_Y', y, 10, '/', '', '');
}
closeWindowTODAYAT = function(ob)
{
Set_Cookie('TODAYATWINDOW_SHOW', false, 10, '/', '', '');
}
setCoordsSEARCHER = function(ob,x,y)
{
Set_Cookie('SEARCHERWINDOW_X', x, 10, '/', '', '');
Set_Cookie('SEARCHERWINDOW_Y', y, 10, '/', '', '');
}
closeWindowSEARCHER = function(ob)
{
Set_Cookie('SEARCHERWINDOW_SHOW', false, 10, '/', '', '');
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:295122
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4