3 Replies Latest reply on Apr 3, 2013 12:17 AM by sivaprasad9394

    how to invoke business method when switching tab

    aindrilaacharya

      when switching tab,I need to invoke business method from our service class by assigning fully qulified method name in action/actionListener attribute of rich tab. But it is not invoking the method as per my requirement(checked by debugging mode)

      Can any body please help in this context

      Thanks in advance

      Code snippet as follows:

      <rich:tab header="Kyc" id="kyc"

                                      action="#{beanName.clearForm}"

                                          execute="@this">

                                   </rich:tab>

        • 1. Re: how to invoke business method when switching tab
          jhuska

          Hello Aindrila,

           

          have you tried to use itemChangeListener of rich:tabPanel? It needs to operate in server mode (switchType attribute). See VDL doc for tabPanel here:

          http://docs.jboss.org/richfaces/latest_4_3_X/vdldoc/

          for more info.

           

          Regards,

          Juraj Huska

          • 2. Re: how to invoke business method when switching tab
            aindrilaacharya

            Hello Juraj ,

             

            Thanks for ur reply.

            Switch Type of my rich:tabpanel is ajax and I want to call the business method from rich:tab instead of rich:tabPanel.

            Throgh rich:tab property styleclass I can invoke business method but I want to invoke same by using action/actionListner property of rich:tab.

             

            Please reply how to solve that.

             

            Thanks in advance

             

            Regards,

            Aindrila Acharya

            • 3. Re: how to invoke business method when switching tab
              sivaprasad9394

              Hi Acharya,

               

              From rich:tab you can call the backend bean action usin like below,

              using a4j:function it is possible to call the backend while clicking the tab in the screen.In rich:tab ontabenter is there for calling the js scrip and actionListener.

              add this in jap page or xhtml page.

                    

              <rich:tabPanel switchType="ajax" id="tp1" styleClass="tabbertab">

                  <rich:tab limitToList="true" id="GeneralInfo" label="General Info" name="General Info" styleClass="myClass" ontabenter=
              "generalInfoLoad()"

                    status="waitStatusGeneral" reRender="generalInformationPage">

              <a4j:region id="generalInforegion">

                  <a4j:include id="generalInformationPage" viewId="/generalInfo.jsp"
              />

              </a4j:region>

              </rich:tab>

               

                <rich:tab limitToList="true" id="ExternalID" label="External ID" name="External ID" styleClass="myClass" ontabenter=
              "externalIDLoad()"

                status="waitStatusExternal" reRender="externalIDPage">

              <a4j:region id="externalIDregion"
              >

                 <a4j:include id="externalIDPage"

              viewId="/external.jsp"/>

              </a4j:region>

              </rich:tab>

               

              </rich:tabPanel>

               

                

                

              <a4j:jsFunction name="generalInfoLoad" limitToList="true" immediate="true"

              reRender="generalInformationPage" ignoreDupResponses="true"

              actionListener="#{existingCustomerBean.submitgeneralInfoTabLoad}"/>

              <a4j:jsFunction name="externalIDLoad" limitToList="true" immediate=
              "true"

              reRender="externalIDPage" ignoreDupResponses="true"

              actionListener="#{existingCustomerBean.submitExternalIDTabLoad}"/>

               

              It will call the backend action bean.

               

              Thanks and Regards,

              Siva