Different Ways Of Using Apex:Param Tag


What Is Parm Tag?
<apex:Param> :- apex:param tag is used to hold java Script values.
param means parameter. This tag is also used to Pass values from 
java Script to an Apex controller. 

The <apex:param> component can only be a child of the following components:

  • <apex:actionFunction>
  • <apex:actionSupport>
  • <apex:commandLink>
  • <apex:outputLink>
  • <apex:outputText>
  • <flow:interview>


 <apex:param name="ParamName" value"{!someValue}" assignTo="{!someproperty}"/> 

value : Required = T R U E

Ques)So, When To Use assingTo & value And How To Use It?
If you use value u can set the value to the query string param name like

<apex:param name="ParamName" value"1234"/> 

& Now, You can access this value in the controller using

Integer res=apexpages.currentpage().getparameters.get('ParamName');


If you use assingTo attribute then this will asigen the value to a property in the controller.
In Visualforce Page:

 <apex:param name="ParamName" value"{!someValue}" assignTo="{!someproperty}"/> 

In The Controller:

public string someproperty {get;set;} 

Now The Value What is Present in Value shall be assign to someproperty



<apex:page controller="paramexample">
 <apex:form >
 <apex:pageblock >
<apex:pageblockTable title="Accounts" value="{!acclist}" var="a">
<apex:column headervalue="Account name">
<apex:commandlink reRender="out" action="{!Paramdemo}">
<apex:param name="aid" value="{!a.name}" assignTo="{!accname}"/>
<apex:column value="{!a.phone}"/>
<apex:column value="{!a.industry}"/>

<apex:outputpanel id="out">
accname = {!accname}

public class paramexample
public string accname{get;set;}
public list<account> acclist { get; set; }

public paramexample(){
acclist = new list<account>();
for(account a : [select id, name, phone, industry from account limit 20])

public void Paramdemo() {}


param example

ssing  param example

Click This To Know  Passing Parameters Using Javascript & ActionFunction