Monday, March 26, 2012

Close Popup and refresh parent window

Here is the sample code for it:

<apex:commandbutton action="{!save}" id="button" oncomplete="javascript:CloseAndRefresh()" value="Update"/>

and here is the java script function

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

No comments:

Post a Comment