Reputation: 597
I have a tab in my XHTML page which looks like below code
<p:tabView widgetVar="tabviewbar">
<p:tab id="livetracking_tab">
// action
</p:tab>
</p:tabView>
I have a JavaScript function in which I have html embedded to a string. I should redirect to livetracking_tab
in myxhtml
page.
<a href='#tabView:livetracking_tab'>Navigate to livetracking tab</a>
Upvotes: 0
Views: 1554
Reputation: 597
From JavaScript using jQuery, the below code worked
$('#tabView ul li a[href="#tabView\\:livetracking_tab"]').click();
Upvotes: 0
Reputation: 86
From JavaScript
you can switch tabs.
PF('tabviewbar').select(0);
As parameter you can pass the tab index.
Upvotes: 4