+ Start a Discussion
stripathystripathy 

Apex tabpanel not working - tab switch is not happening

I have pretty simple code which was working on an older sandbox, when i migrate to a new one, nothing happens when i click on other tabs.

<apex:page standardcontroller="Opportunity" extensions="ExtendedSalesProcess">

 <style>
      .activeTab {background-color: #236FBD; color:white; 
         background-image:none}
      .inactiveTab { background-color: lightgrey; color:black; 
         background-image:none}
   </style>
   <apex:tabPanel switchType="set" selectedTab="tabdetails" 
                  id="AccountTabPanel" tabClass="activeTab" 
                  inactiveTabClass="inactiveTab">   
      
      <apex:tab label="Solution Mapping" name="AccDetails1" id="tabdetails1">
      <apex:include pageName="OpportunityDealSummary"/>
      </apex:tab>
      <apex:tab label="Tech Plan" name="AccDetails2" id="tabdetails2">
      <apex:include pageName="OpportunitySE"/>
      </apex:tab>
       <apex:tab label="Lead" name="LeadDetails3" id="tabdetails3">
       <apex:include pageName="OpportunityLead" rendered="true"/> 
       </apex:tab>
      <apex:tab label="Competitor Intelligence" name="AccDetails4" id="tabdetails4">
      <apex:include pageName="OpportunityCompetitor"/>
      </apex:tab>

      <apex:tab label="Notes and Attachments" 
                name="NotesAndAttachments" id="tabNoteAtt">
         <apex:relatedList subject="{!opportunity}" 
                           list="CombinedAttachments" />
      </apex:tab>
     
       </apex:tabPanel>
</apex:page>
ShashankShashank (Salesforce Developers) 
This could be due to some other javascript code interfering with the tabpanel functionality. Please check if there are any home page components in the sidebar which are causing this.
Jayant Kumar JaiswalJayant Kumar Jaiswal
Hi,

Please change selectedTab attribute of apex:tabPanel.
selectedTab should contain the "id" of any tab which you want to be default selected.
Try This:
 <apex:tabPanel switchType="set" selectedTab="tabdetails1" 
                  id="AccountTabPanel" tabClass="activeTab" 
                  inactiveTabClass="inactiveTab">  
 
Jayant Kumar JaiswalJayant Kumar Jaiswal
Also keep switchType="client"