+ Start a Discussion
Jon Mountjoy_Jon Mountjoy_ 

Can I parameterize page component's "action" attribute?



ie. how can I pass a parameter to a "page" component's "action" method? 


I have a simple Visualforce page 


<apex:page controller="JoinController" action="{!go}"/>


 with a simple controller


public class JoinController {

public PageReference go() {
PageReference regPage = new PageReference('http://wiki.developerforce.com/events/regular/registration.php');

return regPage;



(It redirects, copying the HTML params)


What I'd prefer to do is parameterize go().   Can you recommend how I do that?  ie. I want to write this



<apex:page controller="JoinController" action="{!go}">
<apex:param assignTo="{!website}" value="http://wiki.developerforce.com/events/regular/registration.php"/>


 But param doesn't appear to be supported for a page component.  


Any ideas how I can solve this?









<apex:param> can be child component of following -: 


Check this link :  https://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_param.htm

You can use onloadJS if you want to send some parameter onload of this page like -:

<script type="text/javascript"> window.onload = setupPage(test); </script>
<apex:actionFunction  name="setupPage" >
<apex:param assignTo="{!testvar}" value="{!testvar}" />