function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ashritha ReddyAshritha Reddy 

Action support issue?

action support means a component that adds an ajax support to another component,allowing the component  to be refreshed asynchronously by the server when a particular even occurs

now my doubt is how the event can establish the relation between components to the server..can any one give me the examples please?
nagendra 6989nagendra 6989
Hi Ashritha Reddy,

As i understand that you want to know how the relation gets established between a component and server when action support is used ......

Action Support : 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.

In the example below, initially count value is set to 0. But when we will click on ‘Click here to increment! ‘, then controller action method will be called and count will be incremented. Also outputText component will be rendered without refreshing complete page.

Similarly when we will click on ‘Click here to decrement!’, then controller action method will be called and count will be decremented. Also outputText component will be rendered without refreshing complete 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.

Example : 

VisualForce Page :

<apex:page controller="actionSupportController">
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockSection >
                <apex:outputpanel id="panel1">
                    <apex:outputText value="Click here to increment!"/>
                    <apex:actionSupport event="onclick" action="{!incrementCounter}" rerender="out"/>

                <apex:outputpanel id="panel2">
                    <apex:outputText value="Click here to decrement!"/>
                    <apex:actionSupport event="onclick" action="{!decrementCounter}" rerender="out"/>

                <apex:outputText value="{!count}" id="out" label="Count Is:"/>


Controller Page  : 

public class actionSupportController {
    Integer count = 0;

    public PageReference incrementCounter() {
            return null;

    public PageReference decrementCounter() {
            return null;

    public Integer getCount() {
        return count;

Screenshot for action support

You can also check the below links for more exapmles................



Please let me know if it helps you...............

Thanks & Regards