How to call controller method inside the tab panel in visualforce page? I am trying to call my controller methods like shown below but this dosen't work.
Below are the codes from my VF page and controller. I want to navigate to the 'page1' vf page(mentioned in tab label 'Campaign Feedback') through the method 'campaignpage' which i have written in my controller. All other pages which are mentioned onTabEnter are working fine. I did not go for onTabEnter for campaign also since current page(Event) Id needs to be passed to my campaign page and my controller method does that.
Any suggestions would be a Great help! Thanks in advance.
<apex:page standardController="Event" extensions="eventControllerExtension" id="thisPage">
<script type="text/javascript">
function func()
{
CallApexMethod();
}
</script>
<apex:pagemessages />
<apex:sectionHeader title="Event" subtitle="{!Event.Subject}"/>
<apex:form >
<apex:tabPanel switchType="ajax" id="tabVerify1" selectedTab="c">
<apex:actionFunction name="CallApexMethod" action="{!campaignpage}" />
<apex:tab label="Event" name="name1"> You are in Event Page! </apex:tab>
<apex:tab label="Campaign Feedback" rendered="{!readonly}" onclick="func()" id="tabDetails" >
</apex:tab>
<apex:tab label="Chargeable Single Order" onTabEnter="window.parent.location.replace('/apex/page2');" > </apex:tab>
<apex:tab label="Giveaway Order" onTabEnter="window.parent.location.replace('/apeX/page3');" > </apex:tab>
</apex:tabPanel>
</apex:page>
My Controller
public PageReference campaignpage()
{
Event eve =(Event)stdCtrl.getRecord();
upsert eve;
pageReference saveAndRedirectPage = page.page1;
saveAndRedirectPage.setRedirect(true);
saveAndRedirectPage.getParameters().put('id', eve.id);
return saveAndRedirectPage;
}