2 Replies Latest reply on Mar 2, 2012 7:13 PM by kamal_khadka

    switching rich:tab with a links

    kamal_khadka Newbie

      Currenly there are 4 tabs first one is welcome tab which is displayed by default and other three are services we offer. In a welcome tab I want to write a short description about each services and have a link at the end of description. When the link is clicked they should go to the tab of services they were reading about.

       

      -----------------------------------------------------------

      WELCOME | SERVICE 1 | SERVICE 2

      ----------------------------------------------------------

       

      Welcome ....

       

      SERVICE 1: To get more info click here

       

      SERVICE 2: To get more info click here

                                                                

       

      Above is a mock up of my page. Now when the click here link is clicked for service 1 then SERVICE 1 tab should be shown.

       

       

      Thanks for help.

        • 1. Re: switching rich:tab with a links
          iabughosh Master

          hello kamal,

          you can use rich:tabPanel java script API,

           

          <h:commandLink value="Service 1" onclick="#{rich:component('yourTabPanelId')}.switchToItem('yourTargetTabId'); return false;"/>

           

          you can also use :

          #{rich:component('yourTabPanelId')}.nextItem(); return false;

          #{rich:component('yourTabPanelId')}.prevItem(); return false;

           

          regards.

          • 2. Re: switching rich:tab with a links
            kamal_khadka Newbie

            Thanks for that. That look like it will work, will try it.

             

            The way I did is as below:

             

            <h:commandLink action="#{serviceTabMediator.setServiceTab('sas')}" value="Click Here">

                                <a4j:support event="onclick" reRender="menuTab"></a4j:support>

            </h:commandLink>

             

             

            Thanks again

            1 of 1 people found this helpful