You need to sign in to do that
Don't have an account?
pageBlockTable, actionSupport, and param
Here is my failing VF and Apex code. I'm trying to pass the value of a particular record's ID in a pageBlockTable to the controller with an apex:param inside an actionSupport....
<apex:pageBlockTable value="{!attendees}" var="a" title="Attendees">
<apex:column> <apex:facet name="header"> <apex:commandLink value="Confirmed ({!numConfirmed})" action="{!doSort}" rerender="attendees" styleClass="checkBoxes"> <apex:param name="sortField" value="Confirmed__c" assignTo="{!sortField}"/> <apex:param name="defaultSortOrder" value="desc" assignTo="{!defaultSortOrder}"/> </apex:commandLink> </apex:facet> <apex:inputField value="{!a.Confirmed__c}" styleClass="checkBoxes"> <apex:actionSupport event="onclick" action="{!updateAttendees}" rerender="attendees"> <apex:param assignTo="{!csiToUpdate}" value="{!a.Id}" /> </apex:actionSupport> </apex:inputField> </apex:column>
For whatever reason the apex:param inside the apex:actionSupport doesn't seem to be assigning the value of a.Id to the csiToUpdate property in the controller. Keep in mind that the apex:param elements in the headers are working as expected. I feel like because it's within a loop, there is an issue. Does anybody know what I'm doing wrong here? Here's the relevant controller code:
public string csiToUpdate {get;set;} public void updateAttendees() { system.debug('FFFFF ' + csiToUpdate); }
The debug always shows "FFFFF null". What I was doing before was that the updateAttendees() method would simply update the entire list of attendees. However, when that list gets long, it takes a long time. I'm trying to have it update only the record that had a checkbox clicked. i also tried using an arbitrary name attribute, which was mentioned in some other posts.
What am I doing wrong?