How to Include One Visualforce Page within Another
Sample Code: <apex:page> <p>Test Before</p> <apex:include pageName="MainPage"/> <p>Test After</p> </apex:page>
here MainPage is a another Visualforce page.
<apex:page > Main Page : Welcome to Infallible Techie Site </apex:page> Output:
It doesn't support any attributes to send values. https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_include.htm You can try to pass values in the URL and get it from the controller. Give a try.
Please post one example..
ReplyDeleteThe above code is an example.
DeleteWhat happens if MainPage is attached to a specific controller e.g,
ReplyDelete<apex:page standardController="Account>.
How do you pass the correct Account Id to the MainPage if the Primary Page is a stand alone page?
Add extensions="Class_Name" for populating account id.
Deletehttp://www.infallibletechie.com/2013/10/how-to-get-record-id-from-standard.html
Cheers!
Where would you add the extension?
DeleteIn the main page, or the primary page?
Thanks! Very helpful!
ReplyDeleteHow to pass parameters in apex:include
ReplyDeleteIt doesn't support any attributes to send values.
Deletehttps://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_include.htm
You can try to pass values in the URL and get it from the controller. Give a try.