从支持 bean 中关闭 JSP 弹出窗口?
目前,我的 jsp 中有一个 commandButton 元素,声明如下:
<h:commandButton id="saveButton" value="Save" type="submit" action="#{backingbean.save}" onclick="window.close();" />
单击此按钮后,将调用支持 bean 方法并关闭弹出窗口。我不希望它们同时发生。单击按钮时,我宁愿先调用 save 方法,并在该方法返回后关闭窗口。
我想知道是否可以关闭 save 方法内的弹出窗口并将 onclick 事件处理程序留空。是否可以?
有没有更好的方法在方法保存返回后关闭窗口?
Currently, I have a commandButton element in my jsp declared like this:
<h:commandButton id="saveButton" value="Save" type="submit" action="#{backingbean.save}" onclick="window.close();" />
Once this button is clicked, the backing bean method will be called and the popup window will be closed. I don't want them to take place simultaneously. Upon button click, I'd rather call the save method first and close the window once the method returns.
I was wondering if I could close the popup inside the save method and leave the onclick event handler empty. Is it possible?
Is there a better way to close the window AFTER method save returns?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
让 bean 操作方法导航到仅包含以下内容的页面。
Let the bean action method navigate to a page which contains just the following.