You need to sign in to do that
Don't have an account?
case comments
Pop up window in visualforce
I have a custom button that pops up a VF in another window. I want to be able to click save, close the pop up, and refresh the parent page. The code looks correct, but it doesn't close the pop up window, but instead just refreshes in the pop up window. I have turned off development on my profile and that doesn't seem to fix the problem.
<apex:page standardController="Opportunity" sidebar="false" showheader="false"> <script language="JavaScript" type="text/javascript"> function CloseAndRefresh(){ window.opener.location.href="/{!$CurrentPage.parameters.id}"; window.top.close(); } </script> <apex:form > <apex:pageblock > <apex:pageBlockSection > <apex:inputfield value="{!opportunity.Titles__c}"/> <apex:inputfield value="{!opportunity.stagename}"/> <apex:commandbutton action="{!save}" value="Save" oncomplete="javascript:CloseAndRefresh()"/> </apex:pageBlockSection> </apex:pageblock> </apex:form> </apex:page>
You can change window.top.close() to window.parent.close(). Then try again. If it's not work, can you sent me a dev account to my email. I will check it. Thanks.
Hope this helps.
Thanks,
Samba