Activity Forums Salesforce® Discussions What is the use of 'apex:actionSupport' in Visualforce page in Salesforce?

  • Avnish Yadav

    Member
    August 1, 2018 at 2:09 pm

    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.

     

  • shariq

    Member
    September 18, 2018 at 10:50 pm

    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.

  • Parul

    Member
    September 21, 2018 at 9:29 pm

    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.

Popular Salesforce Blogs

Popular Salesforce Videos