You need to sign in to do that
Don't have an account?

How to add query string parameters to a command button and how to retrieve them
Hi,
How do you add query string parameters to a command button and how do you retrieve them in Apex code? Please advice.
thanks
Paul
In Apex you can access the
String strQueryString = ApexPages.CurrentPage().getParameters().get('QueryString name');
You use the apex:param component nested within the command button. E.g.
The assignTo attribute defines the controller property to store the parameter in. Thus when your getContact() action method is invoked, idForCont will contain the chosen id.
Try a different logic : Call action attribute in a command button, create a pagerefrence method in controller and create a url with some parameters. You can check the parameter in the page as given below :
if('{!$CurrentPage.parameters.rf}' == 'No')
{
window.parent.location.replace('/{!$CurrentPage.parameters.id}');
}
where rf is parameter which is assigned in URL in controller.
The above soloution is only way other wise
<apex:CommandButton value ='{!URLFOR( parameters)}/>
pass the parameter using URLFOR and get values using system.currentpage.methods