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
anuragsinghnsanuragsinghns 

Call a action function and pass param on 'onclick of output link'

Hi People,
I am trying to call an actionfunction on the onlick event of an output link and pass param values to the contoller is this possible?Currently it is not passing anything to the controller

My ActionFunction
<apex:actionFunction name="olla" action="{!testing}" >
<apex:param value="{!Name}" assignTo="{!accountName}" name="name" />
</apex:actionFunction>

My Link
<apex:outputLink onclick="olla('{!a.name}');return false;">{!a.name}</apex:outputLink>
Best Answer chosen by anuragsinghns
Swati GSwati G
Hi,

Use rerender on actionFunction as shown below and try again.

<apex:actionFunction name="olla" action="{!testing}" rerender="dummy" >
<apex:param value="{!Name}" assignTo="{!accountName}" name="name" />
</apex:actionFunction>

All Answers

Swati GSwati G
Hi,

Use rerender on actionFunction as shown below and try again.

<apex:actionFunction name="olla" action="{!testing}" rerender="dummy" >
<apex:param value="{!Name}" assignTo="{!accountName}" name="name" />
</apex:actionFunction>
This was selected as the best answer
Vamsi KrishnaVamsi Krishna
+1 Swati

you can even leave the rerender attribute blank.. here's a reference if you need more details

http://www.laceysnr.com/2010/11/apexactionfunction-and-apexparam-or-how.html
anuragsinghnsanuragsinghns
Worked fine thank you very much but could you explain to me why we need the rerender option?