Home Passing parameters with Command Link

create a command link and pass arguements. In the apex class you can get the parameters and use the value in your code.

Visual Force Page:

<apex:page controller="showCammand"> <apex:form> <apex:commandLink id="commandLink" action="{!displayName}" value="Show my name"> <apex:param name="Name" value="myName"/> </apex:commandLink> <br/> My name: {!name} </apex:form> </apex:page>
 
Apex Class:
public class showCammand()
{
public String name {get; set;}
public void displayName()
{
name = ApexPages.CurrentPage().getParameters().get('Name');
}
}

Leave a Comment

create a command link and pass arguements. In the apex class you can get the parameters and use the value in your code.

Visual Force Page:








My name: {!name}

 
Apex Class:
public class showCammand()
{
public String name {get; set;}
public void displayName()
{
name = ApexPages.CurrentPage().getParameters().get('Name');
}
}

You may also like

Leave a Comment