You need to sign in to do that
Don't have an account?
King Koo
Pass parameters to controller on page load from VF
Hi guys
I have an Account page layout, and there are 2 sections inside the page layout for 2 VF pages that I have.
The subject for the first is "Apple", and the subject for the second is "Orange".
Both are using the same controller extension.
Based on the subject, the controller extension will pull different records from another custom object, so in the Apple section, it's showing my VF page called Apple_Page that shows information about apples, and in the Orange section, it's showing my VF page called Orange_Page that shows information about oranges.
I thought there would be a way for me to pass a parameter on page load of these two VF pages to the controller extension so that the controller extension can retrieve the proper records.
What exactly can I do? I tried actionSupport, actionFunction, but none of them seem to really work. All I want to do is for the Apple_Page to pass a string "apple" on page load to controller extension, and for Orange_Page to pass the string "orange" on page load to the same controller extension.
I thought it would be easy, but I have already spent 5 hours on it today and I think by now I need some help.
Thanks a lot
King
I have an Account page layout, and there are 2 sections inside the page layout for 2 VF pages that I have.
The subject for the first is "Apple", and the subject for the second is "Orange".
Both are using the same controller extension.
Based on the subject, the controller extension will pull different records from another custom object, so in the Apple section, it's showing my VF page called Apple_Page that shows information about apples, and in the Orange section, it's showing my VF page called Orange_Page that shows information about oranges.
I thought there would be a way for me to pass a parameter on page load of these two VF pages to the controller extension so that the controller extension can retrieve the proper records.
What exactly can I do? I tried actionSupport, actionFunction, but none of them seem to really work. All I want to do is for the Apple_Page to pass a string "apple" on page load to controller extension, and for Orange_Page to pass the string "orange" on page load to the same controller extension.
I thought it would be easy, but I have already spent 5 hours on it today and I think by now I need some help.
Thanks a lot
King
I would suggest you to use java script for this. In JS you can use onLoad event and catch in VF.
Example: https://developer.salesforce.com/forums?id=906F0000000957DIAQ
Refer: https://www.salesforce.com/us/developer/docs/pages/Content/pages_js_remoting.htm
<pre>
Apex:pages.currentPage.getParameters().put('apple', appleVal);
</pre>