6 Replies Latest reply on Dec 17, 2012 9:03 AM by robinho

    No action/actionListener for tabs when switchtype=client?

    robinho Newbie

      Hello everyone,

       

      I'm using a tabPanel to switch between different pages, which use different kind of data. The pages all have a couple of forms.

      Since i didn't want to load all data for every page i just used one Data object and only loaded the required data per page.

      I did this by using the actionListener for every tab like shown below.

      This worked great for me in 3.3.1 because i could use switch type ajax.

      Now in RF 4.2.3 i have to surround the tabPanel with a form when using switchtype ajax.

      If doing so my forms inside the tab's won't work anymore so i switched to switchType=client, because no surrounding form is needed.

      But now my actionListeners won't work anymore. I tried different approaches:

       

      action or actionListener for rich:tab, valueChangeListener for tabPanel,

      ontabenter for rich:tab, nothing works. I even tried it with simple alerts but it never gets called.

       

      MyPage

       

      <rich:tabPanel switchType="client" id="tabPanel">

                       <rich:tab

                          actionListener="#{MyBean.changeDataToA}"

                           id="backendUKBankDataTab">

                          <f:facet name="header">

                              <h:outputText value="#{msg.label_DataA}" />

                          </f:facet>

                          <ui:include

                              src="tabs/aTab.xhtml" />

                      </rich:tab>

                     <rich:tab

                          actionListener="#{MyBean.changeDataToB}"

                           id="backendUKBankDataTab">

                          <f:facet name="header">

                              <h:outputText value="#{msg.label_DataB}" />

                          </f:facet>

                          <ui:include

                              src="tabs/bTab.xhtml" />

                      </rich:tab>

      </rich:tabPanel>

       

      MyBean:

      ...

       

      public void changeDataToA(ActionEvent e) {

              data = loadData("a");

          }

       

      public void changeDataToB(ActionEvent e) {

              data = loadData("b");

          }

       

      ...

       

       

      Anybody got a solution for this?