public class ParamCon {
public String s1{get;set;}
public PageReference Send() {
PageReference openvfpage = New Pagereference('/apex/ParamRecieveVF');
openvfpage.getParameters().put('account',s1);
openvfpage.setRedirect(false);
return openvfpage ;
}
}
Basically the apex:param tag is used to pass values from the Visualforce Page to the Apex Controller. A simple Example could be this:
Here Example: Display all the Leads in the Database in a tabulated form. There should be 2 Columns in which the first column would display the Lead Name and the last column will have a Delete button. When the User clicks the Delete button, the corresponding Lead will be Deleted from the Database.
public class ApexParamDemoController{
public Id RecordToDelete {get; set;}
public List<Lead> AllLeads{
get{ return [SELECT Id, Name FROM Lead]; }
}
public void deleteRecord(){
DELETE new Lead(Id = RecordToDelete);
}
}
please go through the below example.
thanks,
Ramesh
Basically the apex:param tag is used to pass values from the Visualforce Page to the Apex Controller. A simple Example could be this:
Here Example:
Display all the Leads in the Database in a tabulated form. There should be 2 Columns in which the first column would display the Lead Name and the last column will have a Delete button. When the User clicks the Delete button, the corresponding Lead will be Deleted from the Database.
Visual Force Page:
Controller:
[If it helps, mark it as "Best Answer"]
Thanks,
Rockzz
Param tag is used to send values from visualforce page to controller, it used with commandbutton, commandlink and action vf tags.