How to refresh the parent window after opening a pop up window from inline page?
1 -> add a function in your inline page that executes window.parent.location=
function refreshParent(){
window.parent.location='URL';
}
2 -> In the popup execute
window.opener.refreshParent()
rather than trying to refresh directly from the popup?
TO be be clear and precise the answer for this with sample code is below
<apex:page standardController="Account" extensions="Accountctrl">
<apex:form >
<script>
function openwindow(){
window.open("/apex/pagereal", "myWindow", "width=200, height=100");
}
function navigate(){
window.top.location.href='https://googleflowauth-dev-ed.my.salesforce.com/001900000096agv';//Parent function that redirects
}
</script>
<apex:pageBlock >
<apex:pageBlockSection columns="1" id="Test" >
<apex:inputcheckbox value="{!test.istest__c}" label="Same as Above">
<apex:actionSupport event="onchange" rerender="Test" />
</apex:inputcheckbox>
<apex:outputPanel rendered="{!NOT(test.istest__c)}">
<apex:inputField value="{!test.Campaign__c}" />
<apex:inputField value="{!test.cust_vendor__c}" />
</apex:outputPanel>
</apex:pageBlockSection>
</apex:pageBlock>
The code for popup will be as below
<apex:page >
<!-- Begin Default Content REMOVE THIS -->
<h1>Congratulations</h1>
This is your new Page
<script>
function test(){
alert('hello');
window.opener.navigate();//call the parent function from child window and that does the trick
}
</script>
<apex:form >
<!-- End Default Content REMOVE THIS -->
<apex:commandButton onclick="test()" value="Test"/>
</apex:form>
</apex:page>