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
SFDC coderSFDC coder 

unable to pass value through apex:param when using apex:actionfunction

hi all,

I have a functionality wherein i need to use aepx:actionfunction and apex:param for an apex:outputlink
The problem:


<apex:column >
         <apex:outputLink value="/{!item.id}" target="_blank" onclick="callAcc();">
         {!item.name}
         <apex:param name="passid" value="{!item.id}"/>
         </apex:outputLink>
        </apex:column>
***********************************

 Id accid=ApexPages.currentPage().getParameters().get('passid');
        System.debug('**** new accountid is'+accid);


When i try to get the param passed in controller it fetches null.How do i fix it?

Thanks,
SFDC Coder
AdrianCCAdrianCC
Hello,

apex:param and the currentPage() parameters are different stuff. Why do you want to get the Id accid as a parameter from the page url? Can you explain what your page does? Can you post entire page and controller please?

Thank you,
Adrian
Vidhyasagaran MuralidharanVidhyasagaran Muralidharan
<apex:param name="passid" value="{!item.id}" assign to="name"/>
name is the string which contain the value you want .you can use it in  controller
Vivek_GuptaVivek_Gupta
<apex:commandLink action="{!setUserID}" style="text-decoration:none" value="{!userList.Name}" rerender="form" onclick = call javascript to open a link new tab>
                           <apex:param value="{!userList.Id}" name="userID"/>

public void setUserID(){
        system.debug ('Apex Parameter' + ApexPages.currentPage().getParameters().get('userID'));
        userID = ApexPages.currentPage().getParameters().get('userID');

Gaurav NirwalGaurav Nirwal
you can this process to solve the problem 
apex:param and the currentPage() parameters are different stuff. Why do you want to get the Id accid as a parameter from the page url? Can you explain what your page does? Can you post entire page and controller please?