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
Nithya S 1Nithya S 1 

How to refresh the parent page after a Save action in a Visualforce page embedded in a page layout?

Hi all,
I have a VF page with a save button using only the standard controller. When the save button is clicked, the entire page was being loaded in the VF section. 
So, I tried using the commandlink with the target_parent like -
<apex:commandLink value="Save" action="{!save}" target="_parent" styleClass="btn">
This worked fine in Chrome and Firefox but didn't work in IE despite checking all settings on IE. It opened a new window in IE with just the VF page.

So, I modified this to a command button like -
<apex:commandButton value="Save" action="{!save}" onclick="window.top.location='/{!<object>.id}'; return true"/>
But this doesn't save the record at all times. The behavior is erratic. At times, it does save the record and at times it doesn't. This behavior is noted on all browsers.

Please assist.

 
Best Answer chosen by Nithya S 1
James LoghryJames Loghry

All Answers

Sameer Tyagi SFDCSameer Tyagi SFDC
Hi Nithya, 

Have you tried  target="_top" ?

Sameer Tyagi

 
Nithya S 1Nithya S 1
Hi Sameer, Yes. I've tried that too. It doesn't work in IE. Thanks!
James LoghryJames Loghry
This was selected as the best answer
Nithya S 1Nithya S 1
Thanks James. I will try out the option. So, it does need an extension. Is it not possible to achieve this with just the standard controller? Thanks!
Nithya S 1Nithya S 1
Thanks James! This worked well.
Nithya S 1Nithya S 1
Hey,
I have another issue with this. I have a few fields that have to be filled out (required=true) in the VF page. But the user could just fill two fields out of five and then click Save. The record has to be saved. At the moment that is not happening. The save button works only if ALL the fields are filled out. Can you please help?
kondru xavier 4kondru xavier 4
Hi friends,
I am doing I frame page to redirect external link but theat needs to display the same page please help me asap