+ Start a Discussion
CvrKCvrK 

ActionSupport and ActionFunction, which one to use when?

Hi,
i have been reading about action tags,it make sense to me that,in few ways both Actionsup and actionfunc works similarly,so far have not found any example other than Onclickevent on actionsup and popup message when used action function.

Can someone provide me with few example situations where we can use only ActionFuc but not Actionsup and similarly only ActionSup works but not ActionFunc




 
Best Answer chosen by CvrK
Ravi Dutt SharmaRavi Dutt Sharma
Hi, check if below link helps you get an understanding about action support and action function

http://salesforceravisharma.blogspot.in/2015/07/actionfunction-and-actionsupport-in.html

All Answers

Sunil PalSunil Pal
Hi Sudhir Reddy,

Please check this it will give you a clear pictire : http://www.cloudforce4u.com/2013/06/difference-between-action-support-and.html
CvrKCvrK
Thanks @sunilI...I have been there before posting here...such a valuable info..but i am looking forwarward to know little more about this topic
Sunil PalSunil Pal
Hi Shridhar Reddy,

Got your point. Apart from that As per my findings. 1- Action function we can use when we can call it by using the Javascript but action support can't. 2- apex:ActionFunction : This component helps to envoke AJAX request (Call Controllers method) directly from Javascript method. 
3- 
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.  Exapmle:
<apex:actionFunction name="sendEmail" action="{!sendEmailFunction}"></apex:actionFunction>
<apex:outputpanel id="counter">
<apex:outputText value="Click Me!: {!count}"/>
<apex:actionSupport event="onclick"  action="{!incrementCounter}"  rerender="counter" status="counterStatus"/>
</apex:outputpanel>

Hope it will help.

 
Ravi Dutt SharmaRavi Dutt Sharma
Hi, check if below link helps you get an understanding about action support and action function

http://salesforceravisharma.blogspot.in/2015/07/actionfunction-and-actionsupport-in.html
This was selected as the best answer