我正在开发一个列出员工的 Coldfusion 应用程序。每当我点击“编辑个人资料”时,都会出现 <cfwindow>
打开后可以编辑并保存到数据库。
保存后,当用户关闭窗口时,我希望重新加载父页面。
我正在使用我的cfwindow
这边走
<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>
最佳答案
适应this example from the documentation为我工作。我将此代码添加到父页面:
<script language="javascript">
function test(name) {
ColdFusion.Window.hide(name);
window.location.reload();
}
</script>
...子页面中的代码:
<cfinput name="button" value="Hide Window"
type="button"
onClick="javascript:test('window name')"/>
关于javascript - 在关闭 cfwindow 重新加载父页面时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17805382/