Activity › Forums › Salesforce® Discussions › What is the use of ‘apex:actionSupport’ in Visualforce page in Salesforce?
Tagged: AJAX, apex:actionSupport, Box, Picklist, Salesforce Event, Visualforce Page
-
What is the use of ‘apex:actionSupport’ in Visualforce page in Salesforce?
Posted by shradha jain on August 1, 2018 at 11:46 AMWhat is the use of ‘apex:actionSupport’ in Visualforce page in Salesforce?
Parul replied 7 years, 7 months ago 4 Members · 3 Replies -
3 Replies
-
Hi Shradha,
ActionSupport: A component that adds AJAX support to another component, allowing the component to be refreshed asynchronously by the server when a particular event occurs, such as a button click or mouseover.
Used when we want to perform an action on a particular event of any control like onchange of any text box or picklist.
Thanks.
- [adinserter block='9']
-
Hi,
apex:ActionSupport : This component adds Ajax request to any other Visualforce component. Example : Commandlink button has inbuilt AJAX functionality however few components like OutputPanel does not have inbuilt AJAX capabilities. So with the help of this component, we can enable AJAX.
<apex:outputpanel id=”counter”>
<apex:outputText value=”Click Me!: {!count}”/>
<apex:actionSupport event=”onclick” action=”{!incrementCounter}” rerender=”counter” status=”counterStatus”/>
</apex:outputpanel>Hope this helps.
-
Adding some points:
actionSupport component adds AJAX support to other components in visualforce. It allows components to be refreshed asynchronously by calling the controller’s method when any event occurs (like click on button). It allows us to do partial page refresh asynchronously without refreshing full page
apex:actionSupport has following attributes in our example:
action: action attribute specifies the controllers action method that will be invoked when event occurs.
event: It is DOM event that generates AJAX request
reRender: It is comma separated id’s of components that needs to be partially refreshed. In our example, we have given its value as ‘out’. So component with ‘out’ id will be refreshed without refreshing complete page.Thanks
Log In to reply.