【问题标题】:open popup and save information in the parent page with struts使用struts打开弹出窗口并将信息保存在父页面中
【发布时间】:2013-04-04 18:09:02
【问题描述】:

我是 struts 的新手,在 struts 1.3 中开发 Java EE 应用程序我有一个要求,我有一个带有按钮“弹出”的父页面,该按钮会打开一个包含表单(输入字段)的弹出窗口。并且子窗口包含一个按钮“保存” 保存时

2)关闭子窗口 3)在父页面以表格形式显示数据 请给我任何想法。

【问题讨论】:

  • 接受您过去提出的答案。

标签: javascript popup struts-1


【解决方案1】:

您的子 jsp 应如下所示:

<script type="text/javascript">
    function saveInParent(){
        window.close();
        window.opener.location.href="parentAction.do";
    }
</script>

<html:form onsubmit="return saveInParent();">
    <html:text property="name"></html:text>
    <input type="submit">Save </input>
</html:form>

你的父级jsp:

<html:form action="/parentAction">
    <html:text property="name"></html:text>
</html:form>

确保您对子窗口和父窗口使用相同的操作类。这样,您可以在子窗口中设置“名称”属性的值并将其显示在父窗口中。

【讨论】:

    猜你喜欢
    • 2012-06-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-08-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-02-23
    相关资源
    最近更新 更多