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
Puru AnnamalaiPuru Annamalai 

Child Page Action Method not Invoked

Hi,

I have 2 VF pages, page1 is parent, page2 is child.

If i execute the page1, the constructor,action method,action function is called perfectly in page1, but the child page( page2 ) invokes only the constructor & action function, it missed the page action method, what would be the reason ?

i think it is something related to execution order, am i right, if yes, kindly post the execution order for this scenario ?

PAGE1:
<apex:page standardController="Account" extensions="page1con" action="{!page1Action}">
  
  <apex:form>
      <apex:actionFunction name="callAction" action="{!callAction}" reRender="block" status="statusblock"/> 
  </apex:form>
  
      <apex:outputPanel id="block">
          [ PAGE1 ]
          {!output}
          <apex:actionStatus id="statusblock" startText="Loading..." stopText=""/>
          <apex:include pageName="Page2" rendered="{!showit}"/>
      </apex:outputPanel>
      
      <script>
          window.setTimeout(callAction,500);
      </script>
 
</apex:page>

PAGE1 Controller:
public class page1con{
    
    public boolean showit{get;set;}
    public String output{get;set;}
    
    public page1con(ApexPages.StandardController controller) {
        output = ' -> page1 Constructor';
        showit=false;
    }

    public void callAction() {
        output += ' -> page1 Onload Action Function';
        showit = true;
    }
    
    public void page1action() {
        output += ' -> page1 Page Action';
    }

}

PAGE 2:
<apex:page standardController="Account" extensions="page2con" action="{!page2Action}" showHeader="false">
 
 <apex:form>
      <apex:actionFunction name="callAction" action="{!callAction}" reRender="block" status="statusblock"/>
 </apex:form>
 
 <script>
           window.setTimeout(callAction,500);
 </script>
 
      <apex:outputPanel id="block">
          [ PAGE2 ]
          {!output}
          <apex:actionStatus id="statusblock" startText="Loading..." stopText=""/>
      </apex:outputPanel>
 
</apex:page>

PAGE2 Controller
public class page2con{

    public string output{get;set;}
    
    public page2con(ApexPages.StandardController controller) {
        output=' -> page2 Constructor';
    }
    
    public void callAction() {
        output += ' -> page2 Onload Action Function';
    }
    
    public void page2action() {
        output += ' -> page2 Page Action';
    }

}

OUTPUT
[ PAGE1 ] -> page1 Constructor -> page1 Page Action -> page1 Onload Action Function
[ PAGE2 ] -> page2 Constructor -> page2 Onload Action Function