You need to sign in to do that
Don't have an account?
anuragsinghns
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>
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>
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
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>
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