+ Start a Discussion
IBeginnerIBeginner 

Apex:tab issues

Hi,

 

I have a visualforce page which have apex:tabs included. The apex:tabs are using apex:include to include visualforce pages into it. The issue I have is when I do an action in a page, I want one of the pages which is included in the tab to get refresh. Any ideas on how to do this? Code of the page looks as follows:

 

<apex:page standardController="Object__c" extensions="ObjectCE">
<apex:pageBlock >
    <apex:tabPanel >
        <apex:tab name="tab1" title="Tab1" label="Tab1">
         <apex:include pageName="Page1"/>
        </apex:tab>
        <apex:tab name="tab2" title="Tab2" label="Tab2" >
         <apex:include pageName="Page2"/>  
        </apex:tab>
        <apex:tab name="tab3" title="Tab3" label="Tab3">
            <apex:include pageName="Page3"/>
        </apex:tab>       
    </apex:tabPanel>
</apex:pageBlock>
</apex:page>

 

I will invoke an action in Page2 and I want this to refresh Page3, so when the user activates Tab3 it should have the refreshed values.



r1985r1985

Hi,

 

Can u post the controller class??

 

 

Thanks,

MVP

rohitsfdcrohitsfdc

try adding switchType="server" in the <apex:TabPanel>

<apex:tabPanel switchType="server" >

 

 

IBeginnerIBeginner

I tried this but it didnt work.

IBeginnerIBeginner

Hi,

 

Right now the controller class doesn't have any code for the main page as everything for each page is done using there own controllers.

 

I have found a solution.

 

Reason here is when we do an action in Page2 (the action method return null) it updates the page2 with the changes, but when I click on Page3 it shows old data because the constructor associated with the Page3 controller is not called and it does populates the old data set which is in the page, as the data sets are updated by the controller constructor.

 

The solution I gave was to reinitialize the data set every time it is requested so the data set were updated.