struts2中关闭弹出窗口并重定向到父窗口
我有弹出窗口,在其中上传添加新用户的 Excel 文件。 单击按钮并成功将用户添加到数据库后,我想关闭弹出窗口并刷新父窗口以查看更新。在父窗口中,它显示用户列表。
如何在 Struts2 和 javascript 中处理所有这些事件和步骤?
function callAddUsers() {
document.frmUpload.action = "addUsers.action";
document.frmUpload.submit();
}
我也想显示一些有关在父窗口中添加了多少用户的消息。我如何通过操作传递所有这些信息?
现在的问题是,当我成功上传并添加用户时,弹出窗口显示用户列表,并且我打开了两个窗口。
谢谢。
I have pop up window , in which to upload an excel file of adding new users.
After clicking the button and successfully added the users into DB, I want to close the pop up window and refresh the parent window to see the updates. In Parent Window, it shows the list of users.
How can I handle all of these events and steps in Struts2 and javascript?
function callAddUsers() {
document.frmUpload.action = "addUsers.action";
document.frmUpload.submit();
}
I want to display some messages of how many users added in parent window too. How can I pass all those info by action?
Now the problem is when I successfully uploaded and added users, the popup window displays the list of users and I have two window opened.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
简单的解决方案。
只是
window.close();
弹出窗口和target="main"
,这里只是父窗口的目标名称。一切都很完美:)Simple solution.
just
window.close();
the popup window andtarget="main"
, in here just target name of the parent window. all works perfectly :)