I have a page with a button say button 1 which opens a rich popup panel, the popup panel has rich tabpanel within it with rich tab, and a4j command button.
Now if i click the second tab in the rich tabpanel and click the a4j command button, the command button does some processing and hides the popup panel.
Afterward when the button i.e button 1 on the page is fired , the popup panel is loaded but the rich tab within the popup panel has the second tab in focus instead of first tab.
I think the focus should be on the first tab. I'm not able to identify the problem.
here is the page code.
<div id="mydiv">
<h:form>
<a4j:commandButton onclick="maskk()" render=":pnl :tt :ttt" action="#{test.testAction}" value="test_action" oncomplete="#{rich:component('popUpPanel1')}.show();return false;"/>
</h:form>
</div>
<div id="mydiv1">
<rich:popupPanel id="popUpPanel1" modal="false" height="300" width="500">
<f:facet name="header">
<h:outputText value="Header
Test Panel" />
</f:facet>
<f:facet name="controls">
<h:graphicImage alt="X" onclick="#{rich:component('popUpPanel1')}.hide()"/>
</f:facet>
<h:panelGroup id="pnl">
<h:form id="popUpPanelFrm">
<a4j:commandButton value="test" action="#{test.testAct}" oncomplete="#{rich:component('popUpPanel2')}.show();return false;"/>
</h:form>
</h:panelGroup>
</rich:popupPanel>
</div>
<rich:popupPanel id="popUpPanel2" modal="false">
<f:facet name="header">
<h:outputText value="Test Only Panel" />
</f:facet>
<f:facet name="controls">
<h:graphicImage alt="X" onclick="#{rich:component('popUpPanel2')}.hide()"/>
</f:facet>
<h:form id="aa">
<a4j:commandButton action="#{test.testAct}" value="btn_popUpPanel2"/>
<rich:tabPanel switchType="ajax" id="nrt" style="font-size: 20px">
<rich:tab header="Notes" id="n">
<h:inputTextarea id="note" value="#{test.note}" style="width: 350px;height: 70px"/>
</rich:tab>
<rich:tab header="Recommendations" id="r">
<h:inputTextarea id="recommendation" value="#{test.recom}" style="width: 350px;height: 70px"/>
</rich:tab>
</rich:tabPanel>
<h:panelGroup id="nrPopUpPanelBtn">
<a4j:commandButton style="margin: 5px 0 0 0px" id="btnSubmit" oncomplete="#{rich:component('popUpPanel2')}.hide();unmaskk();" action="#{test.testNR}" value="Ok"/>
<a4j:commandButton style="margin: 5px 0 0 20px" id="btnCancle" onclick="#{rich:component('popUpPanel2')}.hide();unmaskk();" value="Cancel"/>
</h:panelGroup>
</h:form>
</rich:popupPanel>
Thanks You