[process] Close popup when calling it in modal window
authorAsier Lostalé <asier.lostale@openbravo.com>
Mon, 24 Jan 2011 15:44:39 +0100
changeset 10102 20bd2f77ec89
parent 10101 b8c227ba3b24
child 10103 7666ee29fddd
[process] Close popup when calling it in modal window
src/org/openbravo/base/secureApp/PopUp_Response.html
--- a/src/org/openbravo/base/secureApp/PopUp_Response.html	Mon Jan 24 17:57:12 2011 +0100
+++ b/src/org/openbravo/base/secureApp/PopUp_Response.html	Mon Jan 24 15:44:39 2011 +0100
@@ -24,16 +24,23 @@
 }
 
 function submitThisPage(ref) {
-    
-  if (top.opener.submitCommandForm) {
+  if (top && top.opener && top.opener.submitCommandForm) {
     top.opener.submitCommandForm("DEFAULT", false, null, ref, '_self');
   } else {
-  	var process = top.opener.OB.ActionButton.executingProcess;
+    
+    var process;
+    
+    if (getFrame('LayoutMDI')) {
+      process = getFrame('LayoutMDI').OB.ActionButton.executingProcess
+    } else if (top && top.opener) {
+      process = top.opener.OB.ActionButton.executingProcess;
+    }
+
     if (process) {
       process.closeProcessPopup(ref);
     }
   }
-  top.close();
+  closePage();
   return true;
 }
 </script>