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
CustomDataIntegrationsCustomDataIntegrations 

apex:param not setting controller property

I have this code on my VF page inside a repeater...

<apex:commandButton value="Get Files Only" action="{!DownloadPreviousOrderFiles}" disabled="{!CanExecuteJob}">
      <apex:param name="anOrderTicket" value="{!prevorder.OrderTicket}" assignTo="{!OrderTicketId}"/>
</apex:commandButton>

 

When I click on the button and enter the DownloadPreviousOrderFiles, the OrderTicketId controller property is null.  What am I missing?

 

 

Best Answer chosen by Admin (Salesforce Developers) 
CustomDataIntegrationsCustomDataIntegrations

You have to use a commandLink and style it like a button.  

 

http://th3silverlining.com/2009/06/12/salesforce-bugs-you/

 

All Answers

Chamil MadusankaChamil Madusanka

You need to rerender from the command button .

 

If a reply to a post answers your question or resolves your problem, please mark it as the solution to the post so that others may benefit.

NiketNiket

This is a kind of bug but you need to use rerender in order to pass the value of <apex:param> to controller.

 

There may be some other reasons as well. You should use <apex:pagemessages> on your vf page to see if there is any error on the page.

apex:pageMessages

Devendra@SFDCDevendra@SFDC

Hi,

 

Please refer the below post by Jeff Douglas to rerender the command button.

 

http://blog.jeffdouglas.com/2010/03/04/passing-parameters-with-a-commandbutton/

 

Hope this helps.

 

Thanks,

Devendra S

CustomDataIntegrationsCustomDataIntegrations

This doesn't seem to work either.  It doesn't call my controller function.

Devendra@SFDCDevendra@SFDC

 

Hi CustomDataIntegrations,

 

Can you please post your code here?

 

Thanks,

Devendra

CustomDataIntegrationsCustomDataIntegrations

You have to use a commandLink and style it like a button.  

 

http://th3silverlining.com/2009/06/12/salesforce-bugs-you/

 

This was selected as the best answer