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>

1 Answer 1

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])}"/>
1
  • 1
    Wow. Extra credit for using dynamic [] notation! Commented Dec 6, 2016 at 23:14

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.