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
hemmhemm 

Edit base content in Dynamic Visualforce Components

I am working with Dynamic Visualforce Components to popup a jQuery dialog to display the related lists for a record on my page.

 

Below is an example.  Notice the getDVF method. This is where I am using the recordID and building the related list objects.  My goal is to show the related list, but remove the header and footer (which I can do by clearing the facets), but I'd also like to clean up the body.  I'd love to get rid of the Action column for example and adjust all links to open with a target="_blank".

 

public with sharing class test_DynamicVF {

    public String recordID {get; set;}
    
    public PageReference runButtonClick(){ return null; }
    
    public Component.Apex.RelatedList getDVF(){
        if(recordID != null){
            Component.Apex.RelatedList det = new Component.Apex.RelatedList();
            det.subject = recordID;
            det.list='Contacts';
            Component.Apex.OutputText header = new Component.Apex.OutputText(value='');
            det.facets.header=header;
            return det;
        }
        
        return null;
    }
    
}

 

I see 2 choices to do this...

 

  • (preferred) Get the standard related list and edit it.
  • Build a new dataTable from scratch, but I would need the results of the describePageLayouts data which is not available in Apex (only the API)

To accomplish the first option, is there any way (via Apex) for me to obtain the body conten and modify it?  In the example above, this would be obtaining the body content of the related list and then modify it.