How to get the selected records from the related list?

StandardSetController is used to get the selected records from the related list.

Visualforce page:

<apex:page standardController="Interest__c" recordSetVar="Interests" extensions="InterestEditExt">
    <apex:form >
        <apex:pageBlock title="Mass Edit of Interest" mode="edit">
            <apex:pageMessages />
            <apex:pageBlockButtons location="top">
                <apex:commandButton value="Save" action="{!save}"/>
                <apex:commandButton value="Cancel" action="{!cancel}"/>
            <apex:pageBlockTable value="{!selected}" var="int">
                <apex:column >
                    <apex:inputField value="{!int.Name}"/>


public class InterestEditExt {
    public interestEditExt(ApexPages.StandardSetController controller) {

List Button:

Adding the button to the page layout in the parent object:


1 comment:

  1. Hi Magulan ,

    I tried the above code ,but i could not get the records displayed.