1

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>
Jeromy French
  • 11,812
  • 19
  • 76
  • 129
uvk
  • 43
  • 7
  • 1
    Stop using cfwindow. Use jQueryUI, or some other library. jQueryUI has a 'dialog' similar to cfwindow that has an event named 'close' that you can listen for and fire off the process to reload the page. – Scott Stroz Jul 23 '13 at 12:13
  • thanks for your response scott. I'm new to this web designing stuff and i dont know much about jquery – uvk Jul 24 '13 at 08:47
  • Then you can start off the right way. Don't use any UI stuff in ColdFusion, the implementation have limitations you will hit very quickly. Learn how to do things the right way from the beginning. – Scott Stroz Jul 24 '13 at 12:06
  • @ScottStroz mission accepted :) thanks scott – uvk Jul 25 '13 at 05:00

1 Answers1

1

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')"/>
Leigh
  • 28,765
  • 10
  • 55
  • 103
uvk
  • 43
  • 7
  • Unless you are doing something inside `onhide()`, you do not need that function or the `ColdFusion.Window.onHide` call. – Leigh Jul 24 '13 at 23:57