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
hegde_hegdekhegde_hegdek 

Not able to close the visualforce window with command ClosePopup()

Hello Friends,

Not able to close the visual force window using the following code

<apex:page >
<script>
function CloseWindow()
{
      var winMain=window.opener;
     
      if (null==winMain)
      {    
         winMain=window.parent.opener;
      }
      winMain.closePopup();
}
</script>>
  <apex:pageBlockButtons >
          <apex:commandButton value="Cancel" onclick="CloseWindow()"/>
  </apex:pageBlockButtons>
</apex:page>

 

 

any help please

regards

hegdek