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
BenPBenP 

VF page showing Files for parameter ID

I have been trying to recycle some code that I used to show a related list on a record, but I've hit the limit of my knowledge (I'm not a real developer).

My goal is to have a button on an opportunity that will take the user to a VF page that shows all related files, but allows them to see more columns than the standard SF page.

This is the page and extension I'm fumbling with.  The query works for sure, but all I'm now seeing any data on the page.  It's like I'm not calling the method correctly.  I'm using this url to pass in the oppID parameter, /apex/OpportunityFiles?oppID=0062F000002nIy8QAE

Page
<apex:page standardController="ContentDocumentLink" extensions="OpportunityFilesExtension" >

<apex:pageBlock title="Files">
   <apex:pageBlockTable value="{!oppFiles}" var="contact">
      <apex:column value="{!contact.ContentDocument.Title}"/>
      
       <apex:column > 
            <apex:facet name="header">Title</apex:facet>
            <apex:outputText value="{!contact.ContentDocument.Title}"></apex:outputText>
        </apex:column>
   </apex:pageBlockTable>
</apex:pageBlock>
    
</apex:page>

Extension
public class OpportunityFilesExtension {

    //public List<ContentDocumentLink> oppFiles = new List<ContentDocumentLink>();
    public List<ContentDocumentLink> oppFiles {get; set;}
    
    public string oppID {get; set;} //holder for passed in Opp ID
    
    public OpportunityFilesExtension(ApexPages.StandardController controller) {
        
    oppID = ApexPages.currentPage().getParameters().get('oppID');
    system.debug('oppID is '+oppID);
    }
    
    //public OpportunityFiles(ApexPages.StandardController controller) {
      //  this.opp= (Opportunity)controller.getRecord(); //get the ID of the current opportunity
    //}
    public List<ContentDocumentLink> getFiles()
    {
         system.debug('oppID in getFiles is '+oppID);
        if (oppID == null)
         return null;
        
        
        oppFiles = [SELECT ContentDocumentId,Id,LinkedEntityId, ContentDocument.Title, 
					ContentDocument.ContentSize, ContentDocument.Description, 
					ContentDocument.FileExtension, ContentDocument.Owner.Name, 
					ContentDocument.LatestPublishedVersionId 
					FROM ContentDocumentLink WHERE LinkedEntityId = :oppID AND ContentDocument.FileExtension != 'snote'
					limit 5 ];
                  
        return oppFiles;
    }
}