You need to sign in to do that
Don't have an account?
LearnSFDC
I-frame-how to pass values to the apex page which I am using as a source in iframe
I am new to salesforce.My requirement is to show values from an external application in salesforce for which i need to pass some input parameters from salesforce.I am using a i-frame in a VF page and using another VF page as the source for the i-frame as i need to do encoding and validation in the child page.My main page is as below
<apex:page standardController="Case"> <apex:iframe id="xyz" src="/apex/ChildPage"></apex:iframe> </apex:page>
How do i get all the values of the Case object from this page to the ChildPage or can i refer to the parent page from the child page.Any pointers is highly appreacitated
Thanks Imran.I should have realized that eventually it is same as an url.
To other beignners who might face the issue pass the param as a querystring as stated above and in the child page you need to use the below piece of code
It will not fetch value from your request parameter.
All Answers
You can either use Query String parameters.
For ex: <apex:iframe id="xyz" src="/apex/ChildPage?par1=val1;&par2..........."></apex:iframe>
Or you can either pass the Case Id to the child page as Query String parameter and in the child page Apex code you can get the Case Id and then further query the Case object based on the CaseId.
ex: <apex:iframe id="xyz" src="/apex/ChildPage?CaseId={!Case.id}"></apex:iframe>
Make the changes accordingly to the code.
Hope this helps.
Thanks Imran.I should have realized that eventually it is same as an url.
To other beignners who might face the issue pass the param as a querystring as stated above and in the child page you need to use the below piece of code
It will not fetch value from your request parameter.
I will suggest you paste that particular piece of code how you did it for both the pages.
You can build validation on parent page for a child page by using javascript and ensure that you are using correct javascript methods. For a child page validation like window.parent.parent.document.getElementById('id of any component').value = '';
Hope this helps.
Hi Pradeep,
I did not get your point.
Can you be little bit clearer?