Friday, June 16, 2017

apex:actionSupport with apex:param example.

1. Create apex class as below example.


/**
 * Controller class for actionSupport with passing parameter example.
 *
 **/
public with sharing class ActionSupportExamCtrl
{
 //Variable responsible for holding param value assigned in from VF.
 public String param1{get;set;}

 //action method called from actionFunction.
 public void method1(){
  System.debug('Parameter passed is '+ param1);
 }
}

2.Create VF as below example.

<apex:page  controller="ActionSupportExamCtrl">
<apex:form id="formId">
<!-- apex:actionSupport with apex:param -->
<apex:inputCheckbox>
   <apex:actionSupport action="{!method1}" event="onclick" rerender="formId">
<apex:param assignTo="{!param1}" name="prmNm" value="[ Your param value ]"/>
</apex:actionsupport>
</apex:inputCheckbox>
Click on checkbox to pass parameter from action support.
    </apex:form>
</apex:page>

Data Cloud Part 1: No Heavy Theory — Let’s Learn Salesforce Data Cloud by Building in a qucik, effective and smart way.

In one line: Data Cloud connects your data, understands your customer, and helps Salesforce take smarter action. Scenario 1 : I Already Bo...