+ Start a Discussion

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:commandButton id="oppLineButton" value="Take CP Lines" action="{!takeCpLines}" rendered="{!entry.isOppLine}">
 	                    <apex:param id="linkParam" name="tempLineId" value="{!entry.tempLineId}" assignTo="{!buttonOppLineTempId}"/>



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.