function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Karan Khanna 6Karan Khanna 6 

Calling Controller Method on a click on apex:tab

Hi All:

I am using apex:tabPanel and have multiple apex:tab's, each tab show different data table my need is to call controller's method whenever user clicks on a tab so that respective data is loaded only when tab is clicked as otherwise if a query data for all the tabs during load of page then it effects performance adversely and it is not required too. I tried below code but this doesn't seems to be working:

 <apex:tabPanel switchType="ajax" selectedTab="name1" id="tabPanel">
<apex:actionFunction name="callClass" action="{!callClass}" rerender="tabPanel" />       
<apex:tab label="My Table1" name="name1" id="tabOne" status="actionStatus" onClick="callClass()">
 <apex:pageBlockTable value="{!myList}" var="p">