1

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>
2

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.