Hello,
i have a problem with the tabbedPane and the "rendered" attribute.
I wanted to shot a login-tab if I´m logged out and hide the others.
If i logged in i will see all othertTabs, but not the login-tab.
Now to my Probmen.
I i´m logged in an change the tab, so the tab Index increades to "3" and after this click on the "logout-tab" i get an error:
"java.lang.IndexOutOfBoundsException: Index: 3, Size: 1"
My code:
<q:tabbedPane
id="tabbedPane1"
loadingMode="ajax"
tabPlacement="top"
tabAlignment="leftOrTop"
frontBorderStyle="1px solid gray;"
tabGapWidth="0"
styleClass="tabbedPane"
tabClass="tabStyle"
selectedTabClass="tab_active"
rolloverTabClass="tab_rollover"
containerClass="tab_container">
<q:tabbedPaneItem rendered="#{!Login.loginSuccessful}">
<f:facet name="tab">
<h:outputText value="Login" styleClass="tab_name" ></h:outputText>
</f:facet>
<f:subview id="login">
<jsp:include page="./login.jsp" flush="true"></jsp:include>
</f:subview>
</q:tabbedPaneItem>
<q:tabbedPaneItem rendered="#{Login.loginSuccessful}">
<f:facet name="tab">
<h:outputText value="Vehicle Explorer" styleClass="tab_name" ></h:outputText>
</f:facet>
<f:subview id="vehicleExplorer">
<jsp:include page="./tree.jsp" flush="true"></jsp:include>
</f:subview>
</q:tabbedPaneItem>
...
<q:tabbedPaneItem rendered="#{Login.loginSuccessful}" >
<f:facet name="tab">
<h:commandLink value="Logout" target="./main.jsp" action="#{Login.doLogout}" styleClass="logout" ></h:commandLink>
</f:facet>
</q:tabbedPaneItem>
</q:tabbedPane>
I also tried to reset the selected index with "q_setTabbedPaneSelectedIndex(tabbedPaneId, index)" but the error is still there.
<h:commandLink value="Logout" target="./main.jsp" action="#{Login.doLogout}" onMouseUp="q_setTabbedPaneSelectedIndex('tabbedPane1', 0);" styleClass="logout" ></h:commandLink>
Is there any chance to reset the Index to "0" when i logged out before the tabbedPane is rerendered ?
Thanks.