从制表符表单链接回tabbedpanel

时间:2010-11-05 22:50:39

标签: java html jsp struts2 struts

我在选项卡式面板中有一个表单,当我提交表单时,我被重定向到新页面。我想重定向到当前标签中的新页面。实现这一目标的最佳方法是什么? 以下是带有表单 -

的选项卡式面板的代码
<%@ taglib prefix="s" uri="/struts-dojo-tags" %>
<%@ taglib prefix="sx" uri="/struts-tags" %>

<html>
  <head>
    <s:head debug="true"/>
  </head>
  <body>
  <center>
  <table border="0" width="50%">
    <tr>
    <td width="100%">

    <s:tabbedpanel id="test" >

      <s:div id="one" label="Tab 1" theme="ajax" labelposition="top" >
        This is the first panel.
        RoseIndia.nt<br>
        JavaJazzUp.com<br>
        NewsTrackIndia.com
      </s:div>

      <s:div id="two" label="Tab 2" theme="ajax">

        <sx:form action="addevent">

    <sx:textfield name="eventBean.eventName" label="First name" />
    <sx:textfield  name="eventBean.eventDescription" label="Last name" />

      <sx:submit/>

</sx:form> 
      </s:div>

      <s:div id="three" label="Tab 3" theme="ajax">
        This is the third panel.<br>
        Java Tutorial<br>
        PHP Tutorial<br>
        Linux Tutorial
      </s:div>

      <s:div id="four" label="Tab 4" theme="ajax">
        This is the forth panel.
      </s:div>

     </s:tabbedpanel>

     </td>
    </tr>
  </table>
  </center>
  </body>
</html>

1 个答案:

答案 0 :(得分:1)

您应该查看提交标记的targets attribute