function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
suresh dupadasuresh dupada 

How to use apex:param

When we user apex:param in the visual force

              what is the use of it.......... please let me know with code example.....................

Best Answer chosen by suresh dupada
Ruwantha  LankathilakaRuwantha Lankathilaka
You can use apex:param to pass data your controller on button click

See the following example 
<apex:page  Controller="Test" >  
    <apex:form >

        <apex:commandButton value="Click Me" action="{!paramBtnClick}">
            <apex:param name="MyParamValue"
                value="10000"
                assignTo="{!paramValue}"/>
        </apex:commandButton>

    </apex:form>
</apex:page> 

public with sharing class Test{

 public Integer paramValue {get;set;}


public void paramBtnClick(){
      system.debug('paramValue ========= ' + paramValue );
}
}
You need to setup debug  then run the page. When you click the button value 10000 will set to controller paramValue. You can search for "paramValue =========" in the debug and check the value.