Thanks for the response Azadi! You are almost to the point I
need.
What I'm trying to accomplish in the detailTest.cfm file is
to have a DIV holds my 'please wait, loading..' message. It is
defined as visible via setting the style display='').
The second div would have display='none' to hide it; this is
where the slow data calcs take time.
When the events in the second div are complete, I want to be
able to call a js function to make DIV1 (please wait) hidden and
DIV2 (form data) visible.
However, I can only get this to work in an anchor that
someone must click. I need the event to happen automatically as
soon as DIV2 (data) is done loading.
I've tried putting the js in-line in the cfwindow source and
also importing it from a separate file, but I either get errors or
the visibility toggles don't work.
Here is a code outline:
test.cfm page (calling page)
===============================
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN"
"
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<script>
ShowHideDiv = function(el){
var theDiv = document.getElementById(el);
(theDiv.style.display == 'none') ? theDiv.style.display = ''
:
theDiv.style.display = 'none';
}
</script>
</head>
<body>
<p>this is the calling page</p>
<cfwindow name="mywindow" center="true" closable="true"
draggable="true"
height="300" width="300" title="My Window" initshow="false"
/>
<A HREF="javaScript:ColdFusion.navigate('detailTest.cfm',
'mywindow');ColdFusion.Window.show('mywindow');
" >click to test</a>
</body>
</html>
detailTest.cfm (cfwindow's source page)
======================
<p>this is a cfwindow</p>
<div id="divBusy" style="border: 1px solid black;
display:block;">
Please wait while the page loads...
</div>
<cfflush>
<div id="divData" style="border: 1px solid black;
display:none;">
... do lots of queries here that take about 5 seconds...
</div>
<!--- ===========
now i want to ***automatically*** toggle the visibility of
both forms so that divBusy is hidden and divData is visible. Here's
what I have tried, but with no luck - js errors. An anchor works
fine, but I don't have any events to trigger this off of. i need to
execute it in-line with the page rendoring.
==============--->
<script language="JavaScript" type="text/javascript">
ShowHideDiv('divBusy'); // this hides the busy div
ShowHideDiv('divData'); // this shows the data div
</script>
Hope this makes sense. i've spent 2 days on this, which just
seems silly. I mean, there has to be a way to do this...
Your support is eternally appreciated. I hope this will
describe the problem in better detail so you can see where I am
stuck.