You need to sign in to do that
Don't have an account?
kmorf_entransform
commandButtons within a pageBlockTable
i have a pageblocktable and i have a list of custom objects Offers. I want to make a button where if u click on it. the current offer will be accepted, but the button doesnt work. Ive also tried commandLink and also it doesnt work. i have also used assignTo an that to doesnt work. can anybody help me on this.
<apex:PageBlockTable var="offer" value="{!Offers}"> <apex:column > <apex:facet name="header">Accept</apex:facet> <apex:commandButton value ="Accept" action="{!AcceptOffer}"> <apex:param name="q" value="{!offer.Id}"/> </apex:commandButton> </apex:column> /////controller public class code{ public List<Offers__c> Offers {set;get} public class AcceptOffer(){ String aOffer = ApexPages.currentPage().getParameters().get('Id') } }
you need change
String aOffer = Apexpages.Currentpage().getparameters().get('q');
because u were used the param name as 'q'.
Hi,
change as follows,
You can get the parameter from "offerID".
Additional link for parameter passing:
http://salesforceworld.blogspot.com/2011/06/parameter-passing-using.html
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.
Chamil's Blog
This is a known issue that you cant pass in parameter with commandButton. You need to rereneder a hidden page block to pass the paramter with commandButton.
Try this