I'm trying to pass a parameter with a commandButton
. I've seen a few ways to do it on the net, but they don't work. What I have now:
<apex:commandButton value="Accept" action="{!acceptDeal}" disabled="{!d.buttonsAreDisabled}">
<apex:param name="deal" value="{!d.theDeal}" assignTo="{!deal}"/>
</apex:commandButton>
the parameter is not being passed through. Many posts suggest to add reRender
to my commandButton
, but when I try that
<apex:commandButton value="Accept" action="{!acceptDeal}" disabled="{!d.buttonsAreDisabled}" rerender="someRerenderText">
<apex:param name="deal" value="{!d.theDeal}" assignTo="{!deal}"/>
</apex:commandButton>
I get the following error:
Visualforce Error
A String, Number, or Boolean is required for attribute 'value' in <apex:param>.
Another option was to change commandButton
to commandLink
with styleClass="btn"
attribute, but commandLink
does not have disabled
attribute that I need.
d.theDeal
anddeal
?d
is a variable responsible for table rows. Each table row is an object in apex code which contains a few other objects from salesforce. Table row is an inner class in the controller.Deal
is a parameter name and there is also adeal
property in the apex class that represents my custom objectDeal__c
.