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
svidyansvidyan 

get source of a typical Visualforce 'View'page

Hi,

 

I was wondering if there is a way to see how the default view of an object along with its related lists is rendered.

I see the XML representation of it in the .layout file of the object.

But is it possible to see the actual visualforce page of the default view?

This will help in my learning of creating VF pages.

 

thanks, svidyan

WizradWizrad

You can only view the source of a standard page after it has been parsed into HTML.  I'm not sure if standard pages are even constructed from visualforce.

 

The general structure to replicate a standard view page would be:

 

 

<apex:page>
   <apex:form>
      <apex:pageBlock>
          <apex:pageBlockButtons>
              <apex:commandButton action="{!edit}" />
              <apex:commandButton action="{!delete}" />
          </apex:pageBlockButtons>

          //Then you have n of the following:
          <apex:pageBlockSection> 
              //Then you have n of the following:
              <apex:pageBlockSectionItem>
                   <apex:outputLabel value="{!BINDTOLABEL}" />
                   <apex:inputField value="{!myObj__c.MyField__c}" />
              </apex:pageBlockSectionItem>
          </apex:pageBlockSection>

      </apex:pageBlock>
   </apex:form>
</apex:page>

 

 

svidyansvidyan

Thank for providing the template.