I think you will have to do tab change using javascript.
While there is a "selectedIndex" property, it's overriden by user
changing tabs. So, unless you set this value before first display of
view, it will have no effect.
Note: instead of having 2 versions of a tab (empty/not empty) it might
be more logic to have 2 version of tab contents:
<t:panelTab id="nthTab">
<h:panelGroup rendered="#{condition_for_empty}">
</h:panelGroup>
<h:panelGroup rendered="#{! condition_for_empty}">
</h:panelGroup>
kewldude a écrit :
any suggestions?
kewldude wrote:
I have a panelTabbedPane wherein I have 4 tabs to display all in all. The
catch here is I have 8 <t:panelTab> inside that panelTabbedPane the reason
is because I have an additional <t:panelTab> for each of those 4 tabs.
Those panelTabs serve the purpose of displaying the tab, but they are not
clickable. (Something like
<t:panelTab id="firstTab_Empty" label="First Tab"
rendered="#{backendController.publishedContactsSize <= 0}"> </t:panelTab>
).
So my t:panelTab looks like this
<t:panelTab id="firstTab">
<t:panelTab id="firstTab_Empty">
<t:panelTab id="secondTab">
<t:panelTab id="secondTab_Empty">
<t:panelTab id="thirdTab">
<t:panelTab id="thirdTab_Empty">
<t:panelTab id="fourthTab">
<t:panelTab id="fourthTab_Empty">
My question is, how do I dynamically select tabs depending on my logic.
Lets say for a certain logic I want to enable tab number 4. I did the
selectedIndex="3" (since index start @ 0), but it didnt work. I tried
selectedIndex="7", since if i will consider all the <t:panelTab> tags, it
is the 7th tab, but it didn't work also.
Care to give a helping hand here?