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
Patrick C Mayer 91Patrick C Mayer 91 

Popup window problem VF

I made some updates to fix other errors and this code stopped working properly. When it calls openPopup() from the commandButton it works normally, but when it is automatically called from the actionStatus I am getting nothing. I have checked my pop-up setting in the browser. Not realy sure what happened.
<apex:page controller="IdleCasePopUp">
    <apex:form >  
    <apex:pageBlock id="myPageId">
        <apex:actionPoller reRender="myPageId" interval="10" status="renderMeStatus"/>
        <apex:actionStatus id="renderMeStatus" onstop="openPopup()"/>
         <apex:commandButton title="Test" value="Show Queue" onclick="openPopup()"/>
         <apex:outputText value="{!dP}"/>
         
<script id="script">
    var newWin=null;
    function openPopup() {
        var url="/apex/autoOpen";
       
        if ({!dP}) {
            newWin=window.open(url, 'Popup','height=500,width=600,left=100,top=100,resizable=no,scrollbars=yes,toolbar=no,status=no');
            IdleCasePopUp.closePopup();
        }
        
        if (window.focus) {
            newWin.focus();
        }
    }

       
    function closeLookupPopup() {
        if (null!=newWin) {
            newWin.close();
        }  
    }
</script> 
    </apex:pageBlock>
    </apex:form>
</apex:page>


Sonam_SFDCSonam_SFDC
You need to rerender actionstatus so that it is triggered:

        <apex:actionPoller reRender="myPageId" interval="10" status="renderMeStatus"/>
        <apex:actionStatus id="renderMeStatus" onstop="openPopup()"/>
         <apex:commandButton title="Test" value="Show Queue" onclick="openPopup()"/>
         <apex:outputText value="{!dP}"/>

reference:http://www.laceysnr.com/2011/05/apexactionstatus-making-it-work.html