In my controller I have the following method

public pagereference goToMaster(string k){
    pagereference redirect = new PageReference('/apex/bridgeToContact?num='+k);
    return redirect;

I need to pass that method into a table that has one hyperlink per line, and insert the string value eachTrns.recipientWalletID into that method [that value is the cell on its left] when the user click, I am not sure about the syntax, could you please help me.

<td><apex:outputLabel value="{!eachTrns.recipientWalletID}"/></td>
<td><apex:commandLink onclick="{!goToMaster({!eachTrns.recipientWalletID})} value="Recipient"/></td>

You don't even need Apex for this functionality. Just use URLFOR:

<apex:commandLink value="Recipient" 
    action="{!URLFOR($Page.BridgeToContact, null, [num=eachTrns.recipientWalletID])}"/>
  • 1
    Wow. Extra credit for using dynamic [] notation! – DavidSchach Dec 6 '16 at 23:14

Your Answer

