从选项卡表单链接回选项卡面板
我在选项卡式面板中有一个表单,当我提交表单时,我会被重定向到一个新页面。我想重定向到当前选项卡中的新页面。实现这一目标的最佳方法是什么? 这是我的带有表单的选项卡式面板的代码 -
<%@ 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>
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>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该查看提交标记的 targets 属性
You shoud take a look at targets attribute of submit tag