function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Issues with the relatedList and repeat tags

I'm currently trying to create a more comprehensive list view for certain users in our organization, so they can see relatedList information for multiple Opportunities at a glance. My code works, except for the fact that the relatedLists that are rendered are all the same. Meaning, that the rendered relatedLists for 2 different records show the same information. Has anyone else come across this issue before when using the repeat tag?


Here is my visualforce code:


<apex:page standardController="Opportunity" recordSetvar="opps"> <apex:pageMessages /> <apex:pageBlock title="Viewing Opportunities"> <apex:form id="theForm"> <apex:panelGrid columns="2"> <apex:outputLabel value="View:"/> <apex:selectList value="{!filterId}" size="1"> <apex:actionSupport event="onchange" rerender="list"/> <apex:selectOptions value="{!listViewOptions}"/> </apex:selectList> </apex:panelGrid> </apex:form> <apex:pageBlockSection id="list"> <table> <apex:repeat var="opp" value="{!opps}"> <tr> <td> {!opp.Name} - {!opp} </td> </tr> <tr> <td> <apex:relatedList subject="{!opp}" list="Leases__r"/> <apex:relatedList subject="{!opp}" list="MerchantApplications__r"/> </td> </tr> </apex:repeat> </table> </apex:pageBlockSection> </apex:pageBlock> </apex:page>