Sunday, August 7, 2022

What is difference between Action support and Action function in salesforce?

These are the AJAX action tags that support the calling of action and refresh the field only not the entire Visualforce page. 1. - Provides support for invoking controller action methods directly from JavaScript code using an AJAX request. An component must be a child of an component. 1. Both action support and function can be used to call a controller method using an AJAX request. * for example call controller onclick of a inputcheck box * or call a controller method onfocus of a input field Well, they both do the same thing of calling controller method. Difference between both: 1. Action function can call the controller method from java script. 2. Action support adds AJAX support to another visualforce component and then call the controller method. for example: Here action support adds AJAX to output panel, so once you click on output panel controller method will be called. 3. Action function cannot add AJAX support to another component. But from a particular component which has AJAX support(onclick, onblur etc) action function can be called to call the controller method. Example: