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
ekarthikekarthik 

Refresh parent window when save and close iframe popup

 

 

 

Hi

   I am  working with projects and project contains several task . 

 

when i selected project , i will show all task it contains.

if task clicked , it will open iframe popup. after editing that page need to save and close the iframe popup .and refresh the parent project page.

 

 I did save and close edit task page . but the parent window doesn't refresh.

 

closing popup iframe done by jquery

lilke 

parent.parent.j$("#project-modal").trigger('reveal:close');

 

if i give window.parent.reload();

doesn't work 

 

any help appriciated

 

thanks

Karthik

Subha ASubha A

Hi Karthik,

 

Could you please try this code:

top.window.opener.location.href = top.window.opener.location;

 

This will refresh the parent window.

 

Thanks

Subha

ekarthikekarthik

Hi

 

   I tried that code but no refresh happen.

i alert parent page location by

 

alert(parent.parent.window.location);

 

it works but when i try

 

top.window.opener.location.href =parent.parent.window.location;

 

doesn't get result

 

Subha ASubha A

Then try

 

parent.parent.window.location.href =parent.parent.window.location;

Amit TripathiAmit Tripathi

try this:


top.window.onunload=function()
{
parent.window.opener.location.href="/{!$CurrentPage.Parameters.opid}";
 }

 

you can replace the url accordingly,this has worked for me although IE 9 has some issues.

Amit TripathiAmit Tripathi

Also, if the pop up is visualforce page and parent page is standard page than you will not be able to do the refresh.

make a vf page and put the detail page in that.

there are some restriction related to domain when refrshing parent window.

 

 

Vinoth Kumar 130Vinoth Kumar 130
Is there any solution for this scenario ? I'm invoking the visualforce page from lightining through iframe. How to close the iframe once the action is completed ?