【问题标题】:Struts2 dojo submit button render issueStruts2 dojo 提交按钮渲染问题
【发布时间】:2013-06-12 05:22:50
【问题描述】:

我在对话窗口中有带有dojo提交按钮(ajax调用)的struts2。我想在提交按钮后保留弹出窗口。但它不保留相同的表单。

<div id="dialog-form">
<form action="finder" method="post" id="form1">
<textarea id="products" name="productNo"><s:property value='productNo'/>
        </textarea>
  <sx:submit targets="dialog-form"></sx:submit> 

父页面表单:

<div id="form_parent">
 <form action="search" method="post">
 -------------------------
 --------------------------
 </form>
 </div>

searchaction.java

public String finder()
{
 ---------------------
 return "search" //which is going to return parent page.
 }

当我提交页面时,它会关闭弹出窗口并打开父页面。如何保留弹窗?

【问题讨论】:

  • 我对dojo插件不熟悉,提交标签中的这个“dialog-form1”是什么
  • 也许window.open 就是你要找的东西。

标签: javascript jquery jquery-ui struts2 dojo


【解决方案1】:

我不知道 struts2,但是按照http://struts.apache.org/release/2.3.x/docs/dojo-submit.html 的文档,我会尝试类似的东西:

<form id="form1" action="search">
    ---------
    ---------
    <sx:submit beforeNotifyTopics="/before" />
</form>

<script type="text/javascript">
    dojo.event.topic.subscribe("/before", function(event, widget){
        dojo.stopEvent(event);
        dojo.xhrPost({
            form : dojo.byId("form1")
        });
    });
</script>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-03-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-06-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多