blue-sky
blue-sky

Reputation: 53786

link back to tabbedpanel from tab form

I have a form within a tabbed panel, when I submit the form I am redirected to a new page. I'd like to redirect to a new page within the current tab. What is the best way to achieve this? Here is my code for the tabbed panel with form -

<%@ 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>

Upvotes: 0

Views: 777

Answers (1)

Maurizio Cucchiara
Maurizio Cucchiara

Reputation: 895

You shoud take a look at targets attribute of submit tag

Upvotes: 1

Related Questions