Within an apex:repeat interation, I want to display a checkbox and run a method from my controller when the checkbox is clicked. The method runs an update statement that will update the current record.
I'm using apex:actionSupport to call the method and am attempting to use apex:param to pass the record Id to the controller. However, the Id is not getting passed to the controller. I've read a lot about apex:param and similar issues but haven't been able crack this as of yet. Any ideas on how my VF page or controller needs to be updated?
<apex:repeat value="{!lectureLearnings}" var="learning">
<apex:outputPanel id='completionStatus'>
<apex:inputCheckbox value="{!completedStatus}">
<apex:actionSupport event="onchange" action="{!completeLecture}" reRender="completionStatus"/>
<apex:param name="completedLearning" value="{!learning.id}" assignTo="{!completedLearning}"/>
</apex:inputCheckbox>
</apex:outputPanel>
</apex:repeat>
public String completedLearning {get;set;}
public PageReference completeLecture(){
system.debug('completedLearning = ' + completedLearning); //returns null in log file
update completedLearning;
return null;
}