layer.open打开的jsf页面刷新问题

父页面使用layer.open打开jsf页面,点击页面上保存后,要求完成后台业务后,关闭jsf页面,然后刷新父页面。

要求看起来比较简单,实现起来比较麻烦:

子页面使用h:commandButton挂接后台业务saveSort

<h:commandButton value="保存" styleClass="button01" onclick="return forSave()" action="#{emp_PersonSortBB.saveSort}"/>

saveSort完成业务后return "success"

jsf配置中配置success转向页面SucceedLayuiClose.jsp

后台可以通过session变量传递参数给SucceedLayuiClose.jsp页面,控制页面行为。

例如是否刷新父页面。

复制代码
   // 以下是关闭子页面
   var index = parent.layer.getFrameIndex(window.name);
   parent.layer.close(index);

<%

复制代码
    String RefreshList=CommonFuns.filterNull((String)session.getAttribute("RefreshList"));
    if(RefreshList.equals("")){
        RefreshList="false";
    }
    session.removeAttribute("RefreshList");
%>
复制代码
if(<%=RefreshList%>){
    parent.document.getElementById("form1:refreshList").click();
}
相关推荐
xurileidian3 小时前
第 17 篇 · 边玩边学Python · for 遍历 enumerate 与 zip
java·前端·python
掘金安东尼4 小时前
更多审查智能体,更少盲区:GitHub Copilot 代码审查是怎么做的
前端·github copilot
Hilaku6 小时前
2026 年了,jQuery 真的该死了吗?
前端·javascript·程序员
zach6 小时前
吃透 React setState 同步异步之谜:从批量更新、事件循环到版本演进的完整拆解
前端·react.js
不服老的小黑哥6 小时前
02-从 pnpm dev 到 Spring Boot 启动:后端服务到底怎么跑起来?
前端
htzyl2066 小时前
javaScript——this 的四种绑定:为什么箭头函数改不了它
前端·javascript
欧雷殿7 小时前
做自己的第一位客户:一人公司的数据治理公开实践
前端·ai编程·团队管理
掘金安东尼7 小时前
换上 Gemini 4 Neon 之后,我改了哪些上下文工程大模型
前端
涛涛ing8 小时前
我把项目里的 Zustand 全删了:代码量减半,Bug 少了,性能还起飞了
前端
map_3d_vis9 小时前
百度地图地图类型切换:普通地图、卫星图、混合图
前端·javascript·地图·百度地图