+ Start a Discussion
smagee13smagee13 

Close page on save action, using windows.top.close

Greetings,

 

Hoping that somebody has seen this or knows what Im doing wrong.  

 

I have a ViaualFoce page that opens based on a custom button.  My desire is that after a user has entered all the necessary info on this VF page, they click save and the page closes.  For whatever reason the page will not work in the way.  If the user clicks on the custom button to launch the page and then edits/enters any information on the page, the save button will not fire the windows.top.close.  Although, if the user doesn't do anything on the page, the windows.top.close does work and the page closes.

 

Any suggestions?

 

VF Page

 

<apex:page standardController="Case" sidebar="false" showheader="false"> <STYLE type="text/css"> .labelCol { text-align: right } .dataCol { text-align: left } </STYLE> <!-- <apex:sectionHeader title="Add Project Case"/> --> <apex:form > <apex:pageBlock title="Add Project Case" id="thePageBlock" mode="edit"> <apex:pageMessages /> <apex:pageBlockButtons > <!-- <apex:commandButton value="Save" action="{!save}" /> --> <apex:commandButton action="{!save}" value="Save" rerender="AJAXTest" status="AJAXStatus" /> <apex:actionStatus startText="(Saving...)" stopText="" onStop="window.top.close();" ID="AJAXStatus" /> <apex:commandButton value="Delete" action="{!delete}" /> </apex:pageBlockButtons> <apex:pageBlockSection title="Basic Information" columns="1"> <apex:inputField value="{!Case.Subject}" required="true" /> <apex:inputField value="{!case.Date_Du__c}" required="true" /> </apex:pageBlockSection> <apex:pageBlockSection title="Case Owners" columns="1"> <apex:outputLabel value="Case Owner" styleClass="labelCol" for="cao" /> <apex:inputField value="{!Case.ownerID}" styleClass="dataCol" /> <apex:outputLabel value="Client Owner" styleClass="labelCol" for="clio" /> <apex:inputField value="{!Case.contactId}" styleClass="dataCol" id="clio" /> <apex:outputLabel value="KA Internal Owner" styleClass="labelCol" for="iio" /> <apex:inputField value="{!Case.Internal_Owner__c}" styleClass="dataCol" id="iio" /> </apex:pageBlockSection> <apex:pageBlockSection title="Additional Information" columns="1"> <apex:inputField value="{!Case.Internal_Date_Due__c}" /> <apex:inputField value="{!Case.Status}" /> <apex:inputField value="{!Case.Description}" style="width:800px; height: 100px"/> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>