You need to sign in to do that
Don't have an account?
uHaveOptions
Visualforce Save Button redirects inside another detailed page after save
I have a VF page in a custom object that has a save button inside a tabpanel and the VF page has a InlineEditSupport. Everytime I update a field and save it, it updates but loads another Detail Page inside my VF page. Any work around this?
<apex:page standardController="Property__c" showHeader="true" sidebar="false"> <!-- Define Tab panel .css styles --> <style> .activeTab {background-color: #081f3f; color:white; background-image:none} .inactiveTab { background-color: lightgrey; color:black; background-image:none} </style> <!-- Create Tab panel --> <apex:tabPanel switchType="client" selectedTab="Property__c" id="AccountTabPanel" tabClass="activeTab" inactiveTabClass="inactiveTab"> <apex:tab label="Property Information" name="name1" id="Property"> <apex:form > <apex:pageBlock > <apex:pageBlockButtons > <apex:commandButton action="{!save}" id="saveButton" value="Save"/> </apex:pageBlockButtons> <apex:pageBlockSection columns="2"> <apex:pageBlockSectionItem > </apex:pageBlockSectionItem> <apex:pageBlockSectionItem > </apex:pageBlockSectionItem> <apex:pageBlockSectionItem > <apex:outputLabel value="Property Name" for="Property__c.Name" style="font-weight:bold"/> <apex:outputField value="{!Property__c.Name}" id="Property"/> </apex:pageBlockSectionItem> <apex:inlineEditSupport event="ondblClick" showOnEdit="saveButton,cancelButton" hideOnEdit="editButton" /> </apex:pageBlocksection> </apex:pageBlock> </apex:form> </apex:tab> </apex:tabPanel> </apex:page>
And in your visualforce page reference this extension as below
<apex:page standardController="Property__c" showHeader="true" sidebar="false" extensions="PropertyExtensionController">
Hope this helps.
All Answers
I would say the easiest way to interupt this behaviour is to stick a reRender on the button. When the button has a reRender - it just redraws a specific part of the page instead of returning the full pageReference (I hope!) change you save button to be
this should cause it to just reload the property tab with the new data, but not do any redirecting.
(thank you for being a good developer and putting IDs on all your elements!)
And in your visualforce page reference this extension as below
<apex:page standardController="Property__c" showHeader="true" sidebar="false" extensions="PropertyExtensionController">
Hope this helps.
Heavy lifting for such a simple problem!
Hello Krishna Sambaraju - that solution worked well but anyway that it will also reload the whole entire page?
Thanks you guys