Tabbedpanel - stay on the current tab, but change the contents of the tab

I have a tab with two tabs, when the user clicks on the second tab, I would like to stay on the current tab, but changed the contents of the tab using the new jsp.

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

So, when the user clicks on the add tab, the user is then redirected to the new confirmed.jsp file in the new tab.

Thanks for any help.

+3
source share
1 answer

Using jQuery will simplify your life, see http://docs.jquery.com/UI/Tabs . This example from this page switches to the third tab

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;
});

Look at the page

0
source

Source: https://habr.com/ru/post/1784553/


All Articles