+ Start a Discussion
Suneel14Suneel14 

Window.top.Close(); is not working in thick box

Hi All, 

 

I have created a button on button click a thick box will open on this window i am showing a vf page and Save button after clicking on save i want to close thick box  but using this code it is not working 

 

this is Button code:

 

{!REQUIRESCRIPT("/resource/1340776059000/JQueryZip/jquery.js")} 
{!REQUIRESCRIPT("/resource/1340776059000/JQueryZip/thickbox.js")} 
$("body","html").css({height: "100%", width: "100%"}); 

$("body").append("<div id='TB_window' style='position: fixed;background: #ffffff;z-index: 102;color:#000000;border: 2px solid #525252;text-align:left;top:40%;left:40%; width:30%; height:20%'><iframe src='/apex/scheduleInvoice?id={!Opportunity.Id}' height='100%' width='100%'/></div>");

 

in VF Page :

 

<apex:form >
<script language="javascript" type="text/javascript">
function CloseAndRefresh(){
window.opener.location.href="/{!$CurrentPage.parameters.id}";
window.top.close();
}
</script>

 

<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!Save}" oncomplete="javascript&colon;CloseAndRefresh()"/>


Navatar_DbSupNavatar_DbSup

Hi,

 

Replace your code of button with following code.

<apex:commandButton value="Save" action="{!Save}" oncomplete="javascript&colon;CloseAndRefresh()"/>

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

Suneel14Suneel14

Hi Ankit ,

thanks for ur reply i have changed but it is not working. 

 

thanks

Suneel