`

showModalDialog 关闭本窗口,刷新父窗口

阅读更多
写道
下午 17:38:09
1.主页
/**
* 功能:打开填写治安档案信息界面
*/
function add(){
URL = "${ctx}/bggl/bgsgl.do?method=gotoGldaAddInput";
window.showModalDialog( URL, window, ' edge: Raised; center: Yes; help: Yes; resizable: No; status: No; scroll: No; titlebar: No; depended: Yes; location: No; menubar: No; toolbar: No; dialogHeight:430px; dialogWidth:700px');

}

2.子页
<base href="<%=basePath%>" target="_self">
<form method="post" name="fom" action="${ctx}/bggl/bgsgl.do">
<input name="method" type="hidden" value="add" />

3.action
/**
* 保存治安档案记录
* @throws IOException
*/
public ActionForward add(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws IOException{
TmeZadajl jl = new TmeZadajl();
bindEntity(form, jl);
service.save(jl);
saveMessage2Session(request, "保存治安记录成功!");
return mapping.findForward("closeModelDiaglog");
}
4.配置
<!-- GlobalForwards -->
<global-forwards>
<forward name="openerReload"
path="/../jsp/common/openerReload.html" />
<forward name="parentOpenerReload" path="/../jsp/common/parentOpenerReload.html" />
<forward name="closeModelDiaglog" path="/../jsp/common/ncp/close_modeldiaglog.jsp" />
</global-forwards>

5.公共页 close_modeldiaglog.jsp
<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
<%@ include file="/jsp/common/ncp/taglibs.jsp"%>
<%
/**
* 功能:用于关闭模态窗口,并且刷新父窗口
*/
%>
<logic:notEmpty name="customMessages">
<logic:iterate id="cMessage" name="customMessages">
<script type="text/javascript">
alert('<c:out value="${cMessage}" />');
window.dialogArguments.location.reload();
window.close();
</script>
</logic:iterate>
</logic:notEmpty>

   

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics