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

Visualforce Component Error 'Read only property' when querying ContentDocumentLink

I'm working on making a Visualforce Email Template and I want to show all related Files related to a record. When I try saving out my Visualforce Component it gives the following error: 'Read only property 'c:compProdInitFiles.ContDocLinks''

I tried removing the 'set' from my class to make it read only but it still throws the error. Any ideas on how to fix? I would think this would be simple but can't resolve. Code is below. Thanks in advance!

Visualforce Component:
<apex:component controller="prodInitFiles" access="global">
<apex:attribute name="relatedId" type="Id" description="Id of the account" assignTo="{!ContDocLinks}"/>
<table border = "2" cellspacing = "5">
    <apex:repeat value="{!ContDocLinks}" var="f">

public class prodInitFiles {

public Id relatedId {get;set;}
public List<ContentDocumentLink> getContDocLinks()
    List<ContentDocumentLink> contDocLink;
    contDocLink = [SELECT ContentDocument.title, ContentDocumentId FROM ContentDocumentLink WHERE LinkedEntityId =: relatedId];
    return contDocLink;

Alain CabonAlain Cabon

<apex:attribute name="relatedId" type="Id" description="Id of the account" assignTo="{!relatedId}"/>