You need to sign in to do that
Don't have an account?
karimulla salesforce
Apex include page with multiple controllers in salesforce development
Using the Includetab with multiple controllers, if yes, iam getting the values in the system.debug(); , but unable to display the values in the visualforce page..!
//iam gettig the value is the system.debug, but unable to dispaly it in the visualforce page..
//can multiple controllers can be used for the Include tag in salesforce
Thank you
<!--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(); } }Included page is:
<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); } }
//iam gettig the value is the system.debug, but unable to dispaly it in the visualforce page..
//can multiple controllers can be used for the Include tag in salesforce
Thank you
Instead of calling apex call you can call visualforce page then name can display is Vf Page.
I'm changing testing method
Try this code.
Note: Replace {Includepage} with your vf page API Name
Regards
Vijay
i am also searching for similar scinarion of the karimulla, By using the Vijay Kumar answer page is redirecting to the 2nd page, i dont want to redirect to the page,
am displaying 2VFpage is inside of the first VFpage , when i click on the Click Me then that time 2VFpage controller will be called and getting value in debug statement not displaying it in the first vfpage, how to display that value ???
Thanks and regards,
Karimulla...!
Whenever concept coming two different pages we should redirect to one page to another there is no other solution. So usually we are using visulaforce components. Using visualforce components no need to redirect to another page.
How to use visulaforce componets in visulaforce page below link will help you:
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_component.htm
If are confusing how to use vf components ask me I'll help you.