You need to sign in to do that
Don't have an account?
Lakshmi S
How to hide save and cancel button in custom detail page?
Hi Team,
How to hide save and cancel button in custom detail page?
<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!Save}" id="saveButton" />
<!-- <apex:commandButton value="Save & New" action="{!saveNew}"/> -->
<apex:commandButton value="Edit" action="{!Edit}" id="editButton" />
<apex:commandButton value="Delete" action="{!Delete}" onclick="if(!confirm('Are you sure?')){return false};" id="deleteButton" />
<apex:commandButton value="Clone" action="{!doClone}" id="cloneButton" />
<apex:commandButton value="Cancel" action="{!doCancel}" id="cancelButton" immediate="true" />
</apex:pageBlockButtons>
Please let me know how can we do this in visualforce page...
Thanks.
Lakshmi.
How to hide save and cancel button in custom detail page?
<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!Save}" id="saveButton" />
<!-- <apex:commandButton value="Save & New" action="{!saveNew}"/> -->
<apex:commandButton value="Edit" action="{!Edit}" id="editButton" />
<apex:commandButton value="Delete" action="{!Delete}" onclick="if(!confirm('Are you sure?')){return false};" id="deleteButton" />
<apex:commandButton value="Clone" action="{!doClone}" id="cloneButton" />
<apex:commandButton value="Cancel" action="{!doCancel}" id="cancelButton" immediate="true" />
</apex:pageBlockButtons>
Please let me know how can we do this in visualforce page...
Thanks.
Lakshmi.
【Step 1. get the inline parameter】
You can add code below to your Apex code to know Visualforce page is viewed in custom detail page or not.
System.debug('ApexPages.currentPage().getUrl()----->' + ApexPages.currentPage().getUrl());
【in custom detail page】
ApexPages.currentPage().getUrl()----->/apex/PictureSlideshow?id=a007F00000EwQur&inline=1
←←← Parameter: inline . Yes, you can get this parameter (inline) to detect . if inline is 1
【not in custom detail page】
ApexPages.currentPage().getUrl()----->/apex/PictureSlideshow?id=a007F00000EwQur
↑↑↑ Without inline parameter.
【Step 2. hidden your button by rendered property】
since you got parameter inline , and then you can set your button is show or not by rendered property