How to get the index of Tab by tab id
up vote
0
down vote
favorite
I am using PrimeFaces 5.0 and I have a TabView
as follow:
<p:tabView id="tabView" widgetVar="tabView">
<p:ajax event="tabClose" listener="#{toDoController.tabClosed}"/>
<!-- Large View -->
<p:tab title="Large View" closable="true" id="largeView" >
<ui:include src="toDo-large.xhtml" />
</p:tab>
<!-- Detail View -->
<p:tab title="Detail View" closable="true" id="detailView"
rendered="#{toDoController.detailViewRendered}">
<ui:include src="toDo-detail.xhtml" />
</p:tab>
<!-- Completed View -->
<p:tab title="Completed View" closable="true" id="complView"
rendered="#{toDoController.complViewRendered}">
<ui:include src="toDo-complete.xhtml" />
</p:tab>
</p:tabView>
So there 2 3 tabs here with different id. Since they are closable and rendered dynamically, so their order may changes.
I would like know if it is possible to get the index of particular tab by the tab id. For example:
getTabIndexById("detailView")
which will return 2 if the Detail tab is the third tab. Thanks.
primefaces tabview
add a comment |
up vote
0
down vote
favorite
I am using PrimeFaces 5.0 and I have a TabView
as follow:
<p:tabView id="tabView" widgetVar="tabView">
<p:ajax event="tabClose" listener="#{toDoController.tabClosed}"/>
<!-- Large View -->
<p:tab title="Large View" closable="true" id="largeView" >
<ui:include src="toDo-large.xhtml" />
</p:tab>
<!-- Detail View -->
<p:tab title="Detail View" closable="true" id="detailView"
rendered="#{toDoController.detailViewRendered}">
<ui:include src="toDo-detail.xhtml" />
</p:tab>
<!-- Completed View -->
<p:tab title="Completed View" closable="true" id="complView"
rendered="#{toDoController.complViewRendered}">
<ui:include src="toDo-complete.xhtml" />
</p:tab>
</p:tabView>
So there 2 3 tabs here with different id. Since they are closable and rendered dynamically, so their order may changes.
I would like know if it is possible to get the index of particular tab by the tab id. For example:
getTabIndexById("detailView")
which will return 2 if the Detail tab is the third tab. Thanks.
primefaces tabview
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am using PrimeFaces 5.0 and I have a TabView
as follow:
<p:tabView id="tabView" widgetVar="tabView">
<p:ajax event="tabClose" listener="#{toDoController.tabClosed}"/>
<!-- Large View -->
<p:tab title="Large View" closable="true" id="largeView" >
<ui:include src="toDo-large.xhtml" />
</p:tab>
<!-- Detail View -->
<p:tab title="Detail View" closable="true" id="detailView"
rendered="#{toDoController.detailViewRendered}">
<ui:include src="toDo-detail.xhtml" />
</p:tab>
<!-- Completed View -->
<p:tab title="Completed View" closable="true" id="complView"
rendered="#{toDoController.complViewRendered}">
<ui:include src="toDo-complete.xhtml" />
</p:tab>
</p:tabView>
So there 2 3 tabs here with different id. Since they are closable and rendered dynamically, so their order may changes.
I would like know if it is possible to get the index of particular tab by the tab id. For example:
getTabIndexById("detailView")
which will return 2 if the Detail tab is the third tab. Thanks.
primefaces tabview
I am using PrimeFaces 5.0 and I have a TabView
as follow:
<p:tabView id="tabView" widgetVar="tabView">
<p:ajax event="tabClose" listener="#{toDoController.tabClosed}"/>
<!-- Large View -->
<p:tab title="Large View" closable="true" id="largeView" >
<ui:include src="toDo-large.xhtml" />
</p:tab>
<!-- Detail View -->
<p:tab title="Detail View" closable="true" id="detailView"
rendered="#{toDoController.detailViewRendered}">
<ui:include src="toDo-detail.xhtml" />
</p:tab>
<!-- Completed View -->
<p:tab title="Completed View" closable="true" id="complView"
rendered="#{toDoController.complViewRendered}">
<ui:include src="toDo-complete.xhtml" />
</p:tab>
</p:tabView>
So there 2 3 tabs here with different id. Since they are closable and rendered dynamically, so their order may changes.
I would like know if it is possible to get the index of particular tab by the tab id. For example:
getTabIndexById("detailView")
which will return 2 if the Detail tab is the third tab. Thanks.
primefaces tabview
primefaces tabview
edited Nov 9 at 8:03
asked Nov 7 at 7:52
Dicky Ho
83
83
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53185376%2fhow-to-get-the-index-of-tab-by-tab-id%23new-answer', 'question_page');
}
);
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password