I currently have a Visualforce page embedded on the contact record that displays all active campaigns with a chexckbox indicating if the contact is a member of the campaign (if checked then the contact is a member). I also have a command button to save changes. The visualforce code is generated using an apex:repeat like as so:
<apex:repeat value="{!campaignWrappers}" var="cm"> <div class="MailingRow"> <apex:outputText styleClass="CampaignLabel" value="{!cm.c.Name}" ></apex:outputText> <apex:inputCheckbox styleClass="CampaignCheck" value="{!cm.selected}" /> </div> </apex:repeat>
My question is, what is the best way to go about passing the checkbox values to the controller? Ideally I would like to pass across only checkboxes that have been changed, passing across a list of those that have been gone from checked to unchecked and a second list that contains the checkboxes that have gone from unchecked to checked. I can then insert and delete these lists.
Is this a case where an actionSupport tag should be used on the checkbox?
<apex:actionSupport event="onChange" action="{!updateChangeList}" />