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:pageBlockButtons>
<apex:pageBlockTable value=”{!selected}” var=”int”>
<apex:column >
<apex:inputField value=”{!int.Name}”/>
</apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
Controller:
public class InterestEditExt {
public interestEditExt(ApexPages.StandardSetController controller) {
controller.setPageSize(10);
}
}
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:pageBlockButtons>
<apex:pageBlockTable value=”{!selected}” var=”int”>
<apex:column >
<apex:inputField value=”{!int.Name}”/>
</apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
Controller:
public class InterestEditExt {
public interestEditExt(ApexPages.StandardSetController controller) {
controller.setPageSize(10);
}
}
List Button:
Adding the button to the page layout in the parent object:
Output: