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
Damien_Damien_ 

Displaying VisualForce page from PageLayout in another VisualForce page with <apex:detail>

I have a Visualforce Page that displays the Opportunities.

 

<apex:page standardController="Opportunity" tabStyle="Opportunity" extensions="OpportunityViewExtension">
  <apex:form >
    <apex:detail id="mylists" relatedList="true" showChatter="true" relatedListHover="true" />

   ....

</apex:page>

 

One of the fields from the PageLayout is another Visualforce Page.

 

<apex:page standardcontroller="Opportunity" extensions="OpportunityFinancialsEditor">
<style>
body{background-color:rgb(243, 243, 236);}
</style>
    <apex:form >
    <apex:pageblock>
    <apex:pagemessages />
    <apex:pageblocktable value="{!grid}" var="row">
        ...

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

 

When this gates displayed on my Visualforce Page it simply makes the section blank with scrollbars.  When I display the Page using InternetExplorer it does the same thing, but also tells me there is an error saying that a reference in my Visualforce page that is displayed on the page layout is null.

Best Answer chosen by Admin (Salesforce Developers) 
Damien_Damien_

I fixed this by moving the <apex:detail> outside of the <apex:form>

 

<apex:detail />

<apex:form>

 ....

</apex:form>

All Answers

Damien_Damien_

The error internet explorer gives when I open this page is:

 

Error: 'document.forms.echoScontrolForm_066300000009GGb' is null or not an object

 

and I'm pretty sure this is a reference to the field that is actually an embedded Visualforce page.

Damien_Damien_

I fixed this by moving the <apex:detail> outside of the <apex:form>

 

<apex:detail />

<apex:form>

 ....

</apex:form>

This was selected as the best answer
Cory CowgillCory Cowgill

Did anyone find a resolution to this that doesn't require moving the <apex:detail> tag outside of the <apex:form> section?

 

Spring 11 released inLine editing. If you want to do inline editing, you need to have your <apex:detail> tag inside an <apex:form>.

 

 

Cory CowgillCory Cowgill

FYI - SF Moderator Stephan has stated that this will be fixed in Summer 11 in another thread.

craskulineczcraskulinecz

This error still happens in Summer '12 if your <apex:detail> is within the <apex:form> tags. You can move the <apex:detail> out from within the <apex:form> tags and the VisualForce page will show up, and inline editing will still work.

Vishal_ThoriyaVishal_Thoriya

Hi craskulinecz

I have tried all suggested solution in this post, but i am still facing issue.