1 Reply Latest reply on Jul 4, 2014 4:01 AM by bluez974

    rich:tab with iterable child on submit

    bluez974

      Hello,

      I have got a really strange behavior on RF4 (4.3.5 and 4.3.7) that I didn't have before migrating from RF 3.3.3.

       

      • I am using rich:TabPanel inside a main form (#h1)
      • 3 tabs 2 of them are rendered depending on the current context
      • 3 beans : mainBean (decide which tab to render) ; subBean2 for tab2 content ; subBean3 for tab3 content
      • tab2 contains an iterable element
      • tab 3 just has an inputText
      • On the first load, mainBean.showTab2 = false and thus the tab2 is not rendered. So on the first load only 2 beans are initialisated mainBean and subBean3 which is good.
      • when clicking on the button save, subBean2 got initialized during the 2nd phase, Apply Request values : That's the problem that i didn't have with RF 3.3.3. It seems that it tries to retrieve and initialize all the component tree inside the tab panel even those which should not be rendered.

       

      This only happens when the non-rendered tab contains an iterable child. 

      • If i initiate my page with showTab3 = true, the subBean3 is not initialized when clicking on save button which is the apropriate bahavior in my mind.
      • if i put a different form for each tab and specifically for the save button, the problem doesn't occur.

       

      Here is my code :

       

      <h:form id="h1" >

      <rich:tabPanel id="tbGen" switchType="client" tabHeaderClass="sin_tabHeader" tabDisabledHeaderClass="sin_tabHeader" >

                      <rich:tab name="tab1" >

                      </rich:tab>

                      <rich:tab name="tab2 rendered="#{mainBean.showTab2}" >

      <!--                     <h:form id="h3"> -->

                                  <rich:extendedDataTable id="tab" value="#{subBean2.rows}" var="r" >

                                      <f:facet name="header">Rows</f:facet>

                                      <rich:column >

                                          <f:facet name="header">Title</f:facet>

                                          <h:outputText value="#{r.lbl}" />

                                      </rich:column>

                                  </rich:extendedDataTable >

                      </rich:tab>

       

                      <rich:tab name="tab3" rendered="#{not mainBean.showTab2}" >

                         <h:input id="it1" value="#{subBean3.textValue} />

                      </rich:tab>

       

                  </rich:tabPanel>

       

                 

      <!--                     <h:form id="h2"> -->

                  <a4j:region id="r1" >

                      <h:inputText id="itObs" value="#{mainBean.obs}" />

                      <a4j:commandButton id="cb1" value="save"

                          execute="@region"

                          action="#{mainBean.save}" />

                  </a4j:region>

      <!--                     </h:form> -->

      </h:form>

       

       

      N.B : i am using Spring and Apache Orchestra to manage my bean initializations.