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
samuisamui 

VisualForce / apex:detail / StandardController extension

Hi everyone,

 

I'm having trouble working with the apex:detail tag.

I must be missing something because even the simplest use case seems to elude me.

 

I have made a VisualForce page which uses a StandardController with a custom Extension.

 

When I insert an apex:detail tag in my visual force page (within a pageBlockSection in case that is of importance), I get it to display my custom object's fields and that's nice.

However I have some fields which were made read-only and they display with a nice padlock in the standard layout, but on my visual force page they simply appear as editable (inlineEdit="true").

 

How can I make them read-only in my visual force page too?

 

For reference here's how I include the apex:detail tag in my page:

<apex:pageBlockSection title="Offer Settings" columns="1">
 <apex:detail relatedList="false" title="false" inlineEdit="true"/>
</apex:pageBlockSection>

 

I have a 2nd issue.

I wanted that VisualForce page to be the default page for my custom object so I have overridden the standard buttons (View, Edit and New). And when I click on New, I get to the page mentionned above but the apex:detail part of the page is simply missing and I can't edit my object's field on creation.

Why is that?

 

And last but not least,

When I click on the Edit button I get redirected to my page but the fields from the apex:detail part of the page remains displayed as outputFields instead of inputFields. I was expecting the fields to appear like when using mode="edit".

Am I missing something?

Is that related to my overridding of the Edit button?