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>

LWC to LWC Communication using Lightning Messaging Service (Part - 2)

In my previous post ( previous post link ) we have learn how to create a Lightning Messaging Service with 6 steps and today we will use the ...