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
Ken_KoellnerKen_Koellner 

Using Param within CommandButton, can I get a value pack?

The commandLink button coded below works fine.  It passes the value from entry.tempLineId to merge variable buttonOppLineTempId.  I consider this a work-around.  It is a link that looks like a button.

 

Below the link a commandButton.  This does not work.  I do not get the merge variable set.

 

Anyone know how param is supposed to work with commandButton.  The VF doc says param can be inside commandButton but give no information on how it behaves in this situation.

 

                    <apex:commandLink styleClass="btn" style="text-decoration:none;" id="oppLineLink" value="Take CP Lines" action="{!takeCpLines}" rendered="{!entry.isOppLine}">
 	                    <apex:param id="buttonParam" name="tempLineId" value="{!entry.tempLineId}" assignTo="{!buttonOppLineTempId}"/>
                    </apex:commandLink>  
                    <apex:commandButton id="oppLineButton" value="Take CP Lines" action="{!takeCpLines}" rendered="{!entry.isOppLine}">
 	                    <apex:param id="linkParam" name="tempLineId" value="{!entry.tempLineId}" assignTo="{!buttonOppLineTempId}"/>
                    </apex:commandButton>  

 

bob_buzzardbob_buzzard

I've found the variable doesn't get set unless I have a rerender attribute on the commandbutton.  Started working this way around winter 11 from memory.