+ Start a Discussion
SFDC_DeveloperSFDC_Developer 

How to pass parameters in window.open for return URL:

I have one string variable which I need to pass for return url. I am not able to pass that in my url.
<apex:pageblockTable value="{!memList}" var="list" id="pbt1" >
    <apex:column headerValue="Edit" width="100px">
        <apex:commandLink onclick="window.open('/{!list.Id}/e?retURL={!Event.Id}')"  value="Edit"  id="edit" style="text-decoration:none;color:#3399CC;"/>
    </apex:column>
</apex:pageblockTable>
Controller:
public class ControllerExt(){
    public string passParameter;
    public ControllerExt(ApexPages.StandardController controller)
     {
        events = (Event)controller.getRecord();        
     }
}

Here passParameter is the string which I need to pass as url.


 
William TranWilliam Tran
First, Lets assume you set the passParameter value to something since I do see in the code.

Second, it's standard practice to create getters and setters.
 
String passParameter;

    public String getPassParameter() {
        return passParameter;
    }

    public void setPassParameter(String s) {
        passParameter= s;
    }

And last, you can access the variable in the VF pages via the standard {!passParameter} syntax

Thx.