+ Start a Discussion
Suneel14Suneel14 

Java Script for refreshing parent window not working in IE

Hi ,

 

I am adding contact from account detailpage by clicking a button contact list I am showing in new window after saving I am closing this window and refreshing parent window.

 

Here is code :

 

<script language="JavaScript" type="text/JavaScript">
function Refresh(){
window.opener.location.href="/{!$CurrentPage.parameters.id}";
window.top.close();
}
</script>

 

<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!Save}" oncomplete="Refresh()"/>
</apex:pageBlockButtons>

 

it is working properly in chrome and fire fox but not working in IE any one can help me.

and in opera even window is closing.

 

Thank You !!!

Best Answer chosen by Admin (Salesforce Developers) 
Navatar_DbSupNavatar_DbSup

Hi,

 

Try the below code snippet as reference:

 

<script language="JavaScript" type="text/JavaScript">

function Refresh(){

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

If(window.opener.progressWindow)

{

window.opener.progressWindow.close();

}

window.top.close();

}

</script>

 

<apex:pageBlockButtons >

<apex:commandButton value="Save" action="{!Save}" oncomplete="Refresh()"/>

</apex:pageBlockButtons>

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

 

All Answers

Navatar_DbSupNavatar_DbSup

Hi,

 

Try the below code snippet as reference:

 

<script language="JavaScript" type="text/JavaScript">

function Refresh(){

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

If(window.opener.progressWindow)

{

window.opener.progressWindow.close();

}

window.top.close();

}

</script>

 

<apex:pageBlockButtons >

<apex:commandButton value="Save" action="{!Save}" oncomplete="Refresh()"/>

</apex:pageBlockButtons>

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

 

This was selected as the best answer
Sujesh RamachandranSujesh Ramachandran

I am facing the same issue but I tried the solution and its not working...

 

For me the parent window is reloading but the child window is not closing....

 

please let me know any work wround for this.

 

Thanks,

Sujesh