You need to sign in to do that
Don't have an account?
Abhishek Saraf
Standard Visual Force Page is Not refreshing from pop child window after closing
I have created a new button on standard page of a Custom Object, which is calling a pop-up window, for that I have wrote following code
JS code On Cllick on button for Standatrd Object Page
alert('Hi');
var newWin=null;
(function(){
})();
function closeSuggestedPopup()
{
window.location.reload();
}
//Following is the VF Pop-up VF Page
<apex:page standardController="Contact_Centre_Campaign__c" extensions="CC_CallListQueueLookup" showHeader="false" sidebar="false">
<script>
function setID(elem){
var queueID = elem.options[elem.selectedIndex];
var hiddenElem = document.getElementById('{!$Component.seletForm.hiddenId}');
var queueName = document.getElementById('{!$Component.seletForm.QueueName}');
hiddenElem.value = queueID.value;
queueName.value = queueID.text;
window.alert(hiddenElem.value+ queueName.value);
}
function CloseWindow(){
alert('hi');
}
</script>
<apex:form id="seletForm">
<apex:actionFunction action="{!reAssignQueue}" name="CallreAssignQueue"/>
<apex:outputLabel value="{!$Label.Queues}"></apex:outputLabel>
<apex:inputHidden value="{!Contact_Centre_Campaign__c.HiddenQueueID__c}" id="hiddenId"/>
<apex:inputHidden value="{!Contact_Centre_Campaign__c.Queue__c}" id="QueueName"/>
<apex:selectList multiselect="false" id="selectQueue" size="1" onchange="setID(this);">
<apex:selectOptions value="{!items}"></apex:selectOptions>
</apex:selectList>
<apex:commandButton action="{!reAssignQueue}" value="Assign Queue" onComplete="javascript:CloseWindow()"/>
</apex:form>
</apex:page>
I have tried same approch with VF page and that was working but for standard Object page it is not working and after oncomplete action I am getting following error
'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://c.cs9.visual.force.com' is therefore not allowed access.
JS code On Cllick on button for Standatrd Object Page
alert('Hi');
var newWin=null;
(function(){
})();
function closeSuggestedPopup()
{
window.location.reload();
}
//Following is the VF Pop-up VF Page
<apex:page standardController="Contact_Centre_Campaign__c" extensions="CC_CallListQueueLookup" showHeader="false" sidebar="false">
<script>
function setID(elem){
var queueID = elem.options[elem.selectedIndex];
var hiddenElem = document.getElementById('{!$Component.seletForm.hiddenId}');
var queueName = document.getElementById('{!$Component.seletForm.QueueName}');
hiddenElem.value = queueID.value;
queueName.value = queueID.text;
window.alert(hiddenElem.value+ queueName.value);
}
function CloseWindow(){
alert('hi');
}
</script>
<apex:form id="seletForm">
<apex:actionFunction action="{!reAssignQueue}" name="CallreAssignQueue"/>
<apex:outputLabel value="{!$Label.Queues}"></apex:outputLabel>
<apex:inputHidden value="{!Contact_Centre_Campaign__c.HiddenQueueID__c}" id="hiddenId"/>
<apex:inputHidden value="{!Contact_Centre_Campaign__c.Queue__c}" id="QueueName"/>
<apex:selectList multiselect="false" id="selectQueue" size="1" onchange="setID(this);">
<apex:selectOptions value="{!items}"></apex:selectOptions>
</apex:selectList>
<apex:commandButton action="{!reAssignQueue}" value="Assign Queue" onComplete="javascript:CloseWindow()"/>
</apex:form>
</apex:page>
I have tried same approch with VF page and that was working but for standard Object page it is not working and after oncomplete action I am getting following error
'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://c.cs9.visual.force.com' is therefore not allowed access.
<script>
function refreshParent() {
window.close();
}
</script>
<apex:commandButton value="Save" onClick="refreshParent();"/>
Plz do disable your develoepment mode.