Question

I'm working on a Coldfusion application that lists employees. Whenever I click on "edit profile" a <cfwindow> is opened which can be edited and saved to the database. After saving, when the user closes the window I want the parent page to reload.

I am using my cfwindow this way

<cfwindow x="0" y="100" width="400" height="400" center="true"
    name="#empname#2" title="Employee details" modal="true"
    closable="true" draggable="true" resizable="true" initshow="false"
    source="http://localhost:8500/tasks/task1/details.cfm?empname=#empname#"/>
<cfform name="form1">
    <cfinput type="button" name="#empname#" value="Edit Profile" onClick="javascript:ColdFusion.Window.show('#empname#')" >
</cfform>
Was it helpful?

Solution

Adapting this example from the documentation worked for me. I added this code to the parent page:

  <script language="javascript">
       function test(name) {    
           ColdFusion.Window.hide(name);
           window.location.reload();
       }
    </script>

... and this code in child page:

<cfinput name="button" value="Hide Window"  
       type="button"  
       onClick="javascript:test('window name')"/>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top