title: Closing popup visualforce window after save
body: <p>I have a button on the Case object that opens this visualforce page below. I want the window to close after save but I can't seem to get it to catch the close command. What it DOES do is when Save is clicked, the pages creates the record then refresh to page to present that record. I want it to save the record and close. Any ideas?</p>
  
  <pre><code>&gt; &lt;apex:page standardController="dingList__c"&gt;
     &lt;apex:form &gt;
            &lt;apex:pageBlock title="{!$User.FirstName} reason's for re-queuing:"&gt;
                &lt;apex:pageMessages /&gt;
                &lt;apex:pageBlockButtons &gt;
                   &lt;apex:commandButton action="{!save}" value="Save" status="closer" rerender="buttons"/&gt;
                   &lt;apex:commandButton value="Cancel" onclick="window.top.close()"/&gt;
                   &lt;apex:actionStatus startText="(Saving...)" stopText="" onStop="window.top.close();" id="closer"/&gt;
                &lt;/apex:pageBlockButtons&gt;
                &lt;apex:pageBlockSection &gt;
                    &lt;apex:inputField id="reason" value="{!dingList__c.Reason__c}"/&gt;
                &lt;/apex:pageBlockSection&gt;
            &lt;/apex:pageBlock&gt;
        &lt;/apex:form&gt;
  &lt;/apex:page&gt;
  </code></pre>