You need to sign in to do that
Don't have an account?
pdo
Close Popup and Refresh Parent
All I want to do is close the popup window and refresh the parent when my save is complete and nothing happens on this. Can anyone help?
Page
<apex:page id="orderpage1" standardController="Order_Item_Junction__c" extensions="oitemController" sidebar="false" showheader="false" > <script language="JavaScript" type="text/javascript"> function closeAndRefresh() { window.close(); window.opener.location.reload(); } </script> <apex:form id="form1"> <apex:pageBlock title="Add Order Items" id="order"> <apex:pageBlockButtons location="top"> <apex:commandButton value="Save" action="{!saveitems}" oncomplete="CloseAndRefresh()" /> <apex:commandButton value="Cancel" action="CloseAndRefresh()" /> </apex:pageBlockButtons> <apex:pageBlockSection id="pbsbundle" title="Available Product Bundles" rendered="true" columns="1"> <apex:pageBlockTable id="pbtbundles" value="{!lstoitem}" var="l" width="100%"> <apex:column headerValue="Order" value="{!l.Order__c}" width="40%"/> <apex:column headervalue="Product Bundle Name" value="{!l.Product_Bundle__c}" width="40%"/> <apex:column headerValue="Quantity" id="iqty" width="20%"> <apex:inputField value="{!l.Quantity__c}"/> </apex:column> </apex:pageBlockTable> </apex:pageBlockSection> <apex:pageBlockButtons location="bottom"> <apex:commandButton value="Save" action="{!saveitems}" oncomplete="CloseAndRefresh()" /> <apex:commandButton value="Cancel" action="CloseAndRefresh()" /> </apex:pageBlockButtons> </apex:pageBlock> </apex:form> </apex:page>
Hi,
I would suggest to check "Development Mode" checkbox. If it is checked, I suspect your required functionality would not work. Try unchecked "Development Mode" checkbox on your profile.
Try this code as well :
<script language="JavaScript" type="text/javascript">
function CloseAndRefresh(){
window.opener.location.href="/{!$CurrentPage.parameters.id}";
window.top.close();
}
</script>
<apex:commandButton action="{!save}" oncomplete="javascript:CloseAndRefresh()" value="Update" id="button"/>
Please try it once and let me know if you still face the issue.
Please mark it as the solution if it answers your question.
Ckeck My Blog
All Answers
Call reload first. window.close should not return, as the script is unloaded when this is called.
Hi,
I would suggest to check "Development Mode" checkbox. If it is checked, I suspect your required functionality would not work. Try unchecked "Development Mode" checkbox on your profile.
Try this code as well :
<script language="JavaScript" type="text/javascript">
function CloseAndRefresh(){
window.opener.location.href="/{!$CurrentPage.parameters.id}";
window.top.close();
}
</script>
<apex:commandButton action="{!save}" oncomplete="javascript:CloseAndRefresh()" value="Update" id="button"/>
Please try it once and let me know if you still face the issue.
Please mark it as the solution if it answers your question.
Ckeck My Blog
Thnaks Niket,
This helped. IT is using a custom action so I had to modify. Here is my final page:
Hi,
I have similar problem. My page has some input fileds and a related list. I have added a custom button for related list and I am opening a popup (VisualForce page) for related list. After closing popup, I want to reload just the related list section to show the new changes.
Any help appreciated.
Thanks
Here is the end code I used for both the class and the page. Check it out.
http://boards.developerforce.com/t5/Apex-Code-Development/Junction-Object-Class/m-p/383455#M68652
I have the same situation, I have a page consists of check boxes and and a button, on clicking of that button it will generate a PDF,
When i close the PDF and uncheck some of the check boxes, then click on button , the pdf is not dsplayed based on my selection.
second time when i close the pdf and click on the button again, it is getting displayed based on my previous selection.
Please help me . this is very urgent.