2011-01-10 96 views
3

我有一個帶有兩個標籤的tabbedpanel,當用戶點擊第二個標籤上的提交時,我想留在當前標籤上,但改變標籤的內容JSP。tabbedpanel - 留在當前標籤,但改變標籤的內容

<td width="100%"><s:tabbedpanel id="test"> 

     <s:div id="two" label="Search" theme="ajax" 
      href="/Search.action"> 

     </s:div> 

     <s:div id="three" label="Add" theme="ajax" 
      href="/search.jsp"> 

     </s:div> 

    </s:tabbedpanel> 

因此,當用戶點擊添加選項卡中添加,用戶然後被重定向到新的名爲confirmation.jsp新的選項卡中。

感謝您的任何幫助。

+0

這將是最直接的做到這一點用jQuery和struts2-json-plugin。 – Quaternion 2011-01-10 19:32:16

回答

0

使用jQuery將使您的生活更輕鬆,看http://docs.jquery.com/UI/Tabs 這個例子從該頁面切換到第三個選項卡

var $tabs = $('#example').tabs(); // first tab selected 

$('#my-text-link').click(function() { // bind click event to link 
    $tabs.tabs('select', 2); // switch to third tab 
    return false; 
}); 

看一看頁面