+ Start a Discussion

create a list if IDs in my controller from the checkboxes in my visual force page

I coul dreally use some help I have been reading numerous answers and non seem to be complete.
<apex:pageBlockTable id="tbl_ToBeInvited" value="{!srchResults}" var="sr" rendered="{!(srchResults.size > 0)}">
                                                    <apex:column headerValue="checkAllInviteesCheckBox" >
                                                        <apex:inputcheckbox onclick="window.runMyID('{!sr.recordID}',$(this).prop('checked'))"/>
                                                    <apex:column headerValue="Name" value="{!sr.whoName}"></apex:column> 
                                                    <apex:column headerValue="Title" value="{!sr.title}"></apex:column> 
                                                    <apex:column headerValue="Agency / Company" value="{!sr.AgencyCompany}"></apex:column> 
                                                    <apex:column headerValue="Type" value="{!sr.whatType}"></apex:column> 
                                                    <apex:column headerValue="Owner" value="{!sr.owner}"></apex:column> 

This works fine:

I need to be able create a list of these recordIDs in my apex controller.

ANUTEJANUTEJ (Salesforce Developers) 
Hi CesseIJ,

Have you tried checking the below link that has an implementation of getting the selected ids to the apex controller class?

>> https://www.infallibletechie.com/2014/03/how-to-get-selected-records-from-list.html

Do let me know in case if this helps and in case if this comes in handy can you please choose this as the best answer so that it can be used by others in the future.