function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jon Mountjoy_Jon Mountjoy_ 

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

Hi

 

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');

regPage.getParameters().putAll(ApexPages.currentPage().getParameters());
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"/>
</apex:page>

 

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

 

Any ideas how I can solve this?

 

Thanks,

Jon 

 

 

 

 

 

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

<apex:actionFunction>
<apex:actionSupport>
<apex:commandLink>
<apex:outputLink>
<apex:outputText>
<flow:interview>

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}" />
</apex:actionFunction>