You need to sign in to do that
Don't have an account?
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">
....
</apex:pageBlockTable>
tab2...
tab3....
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">
....
</apex:pageBlockTable>
tab2...
tab3....