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
dev.shiv1.3478599680068948E12dev.shiv1.3478599680068948E12 

Can we override visualforce standard controller detail page for inlineEdit?

Hi friends,

I need to override visualforce standard controller detail page. The detail page has inlineEdit. When we edit we need to save which is required to override the standard button(own functionality). Please any hints or ideas could be appreciated....

Thanks......

-Shiva

bob_buzzardbob_buzzard
There isn't a standard visualforce detail page. Are you referring to the standard record view page provided by the platform? If so, you can override this with a visualforce page and support inline editing on the following component:

• <apex:dataList>
• <apex:dataTable>
• <apex:form>
• <apex:outputField>
• <apex:pageBlock>
• <apex:pageBlockSection>
• <apex:pageBlockTable>
• <apex:repeat>

The apex:detail tag also supports inline editing.
dev.shiv1.3478599680068948E12dev.shiv1.3478599680068948E12
//My Controller
public class TitlesEditController { private final Title__c ti; private ApexPages.StandardController stdController; public TitlesEditController(ApexPages.StandardSetController stdController) { } public TitlesEditController(ApexPages.StandardController Controller){ this.ti = (Title__c)stdController.getRecord(); this.stdController = stdController; System.debug('world'); } public PageReference save() { // Put my own stuff here // Do the standard save action return this.stdController.save(); } }

 

<!-- My Page -->
<apex:page standardController="Title__c" recordSetVar="titles" extensions="TitlesEditController"> <apex:form > <apex:pageBlock > <apex:pageBlockTable value="{!titles}" var="t"> <apex:column > <apex:commandLink value="{!t.name}"> <apex:param value="{!t.id}" name="tid"/> </apex:commandLink> </apex:column> <apex:column value="{!t.Testing__c}"/> </apex:pageBlockTable> </apex:pageBlock> </apex:form> <apex:detail subject="{!$CurrentPage.parameters.tid}" relatedList="false" inlineEdit="true"/> </apex:page>

 From the above page and controller we will get the list of titiles with the link for detail page. In the detail page I need to override the save button when we edit the detail page... Does it possible to override the save button for the detail page? Please give me some hint or idea how to approach on this.......

bob_buzzardbob_buzzard

You can't override the save button on the standard edit page.  You have to override the whole Edit page with your own visualforce page.