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
Enrico devEnrico dev 

Use apex:relatedlist in visual force component

This is my VF page "TestPage":

<apex:page standardController="Account">
<c:TestComponent recordId="{!account}" />
</apex:page>

Visual Force component "Test Component":
<apex:component controller="Taccount">
<apex:attribute name="recordId" description="Record Id to show field history for." type="sobject"  assignTo="{!record}" required="true"/>
<apex:relatedList list="Opportunities"/>
<apex:relatedList list="record.Opportunities"/>
</apex:component>


Problem is that  <apex:relatedList list="Opportunities"/> or   <apex:relatedList list="record.Opportunities"/> is not showed in the main page"TestPage".

Do you know how can i show, in the main page, a related list added in a component?

Thanks in advance for any advice.
Gaurav NirwalGaurav Nirwal
VF page "TestPage":

<apex:page standardController="Account">
<c:TestComponent recordId="{!account}" />
</apex:page>

Visual Force component "Test Component":

<apex:component controller="Taccount">
<apex:attribute name="recordId" description="Record Id to show field history for." type="sobject"  assignTo="{!record}" required="true"/>
<apex:relatedList list="Opportunities"/>
<apex:relatedList list="record.Opportunities"/>
</apex:component>