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
karimulla salesforcekarimulla salesforce 

Anybody had used <apex:include pagename> functionality in salesforce

<!--Using the Includetab with multiple controllers-->

<apex:page controller="actionfunctiontest1" >
   
   <apex:form >
        <ul>
          <li onclick="passValueToController('Testing'); return false;" style="cursor:pointer;">Click Me</li>
        </ul> 
     
    <apex:actionFunction name="passValueToController" action="{!testing}" reRender="frm" >
        <apex:param name="selectedval" value="selectedval" assignTo="{!selectedval}"></apex:param>
     </apex:actionFunction>
   </apex:form>
       
    <apex:outputPanel id="frm">
           <apex:include pageName="actionfunctiontest2"/>
     </apex:outputPanel>
      
  </apex:page>

<!--apexclass-->
Apex Controller:

public class actionfunctiontest1 {
 public String selectedval{get;set;}
  // public actionfunctiontest2 t1{get;set;}
  public void testing(){
  system.debug('form the selectedval controller1'+selectedval);
  
      actionfunctiontest2  t1= new actionfunctiontest2();
   } 
}

page2andclass2:
 
<apex:page controller="actionfunctiontest2">
  <apex:form >
 The value passed is:<apex:inputtext value="{!name}"/>
  </apex:form>
</apex:page>


Apex Controller:-

public class actionfunctiontest2 {
   public string name{get;set;}
   public actionfunctiontest2(){
        name =Apexpages.currentPage().getParameters().get('selectedval');
        system.debug('This is the controller2 form 1 im getting the values here');
        system.debug(' sucess:'+ name);
      }
      }

Here iam getting the values in the debug window, but unable to render it in the visualforce page..! how to display it in the visualforce page.

Thank you...!