I have a application that is opening a dhtmlmodal window and based on the action chosen it will close and do nothing; do something backend and then close; close and then open a new modal shortly after.
This last one i am having trouble as I am assigning trying to open the new modal from a custom onclose function. I have attached the code below, the onclose is triggered by a function in the auditpop modal by calling parent.auditpop.close();
If anyone had any ideas or advise i would very much appreciate it.
Code:function auditPopup(){ var map = {"userid" : temp_user,"edit" : "false"}; jQuery.ajax({ type: "GET", url: '/auditwizard-portlet/checkInProgress.jsp', dataType: "html", data: map, global: true, success: function(responseHTML){ var audit_war = "/auditwizard-portlet/view.jsp?userid="+temp_user; auditpop = dhtmlmodal.open("auditbox","iframe",audit_war,"Athena Audit Wizard","width=600px,height=280px,scrolling=1,center=0,top=5px,left=5px"); auditpop.onclose = function(){ audit_type = this.contentDoc.getElementById("prog_audited_type").innerHTML; audit_app = this.contentDoc.getElementById("prog_audited_app").innerHTML; audit_time = this.contentDoc.getElementById("prog_audited_timestamp").innerHTML; audit_grace = this.contentDoc.getElementById("prog_audited_gracePer").innerHTML; audit_save = this.contentDoc.getElementById("prog_audited_saveDate").innerHTML; audit_last = this.contentDoc.getElementById("prog_audited_lastDate").innerHTML; audit_auditee = this.contentDoc.getElementById("prog_audited_auditee").innerHTML; audit_assigner = this.contentDoc.getElementById("prog_audited_assigner").innerHTML; audit_ressignee = this.contentDoc.getElementById("prog_audited_reassignee").innerHTML; audit_user = temp_user; audit_params = "type="+audit_type+"&app="+audit_app+"×tamp="+audit_time+"&graceper="+audit_grace+"&savedate="+audit_save+"&lastdate"+audit_last+"&auditee="+audit_auditee+"&assigner="+audit_assigner+"&reassignee="+audit_reassignee+"&userid="+audit_user; alert(audit_params); auditWizPop(); }; }, error: function(xhr, status, e){ if(xhr.status ==500){ alert("Please Contact Athena with error descript"); }else if(xhr.status == 404){ }else{ alert("Error has occured with "+xhr.status); } } }); } function auditWizPopup(){ var auditwizURL = "/auditwizard-portlet/application_audit_wizard.jsp?"+audit_params; audit_wizard = dhtmlmodal.open("audit_wiz","iframe",auditwizURL,"Athena Audit Wizard (In Progress...)","width=1180px,height=700px,scrolling=1,center=0,top=5px,left=5px"); audit_wizard.onclose = function(){var audit_data = this.contentDoc.getElementById("audit_main_div").innerHTML; var audit_app = this.contentDoc.getElementById("wiz_audited_app").innerHTML; var audit_time = this.contentDoc.getElementById("wiz_audit_timestamp").innerHTML; var map = {"random" : Math.floor(Math.random()*1000) , "app" : audit_app , "user" : "<%out.print(users);%>" , "time" : audit_time , "data" : audit_data}; jQuery.ajax({ type: "POST", async: false, url: '/auditwizard-portlet/SaveAuditToDB.jsp', dataType: "html", data: map, global: true, success: function(responseHTML){ alert("Save Successful"); audit_wizard.hide(); }, error: function(xhr, status, e){ if(xhr.status ==500){ alert("Please Contact Athena with error description"); }else if(xhr.status == 404){ }else{ alert("Error has occured with "+xhr.status); } } }); };



Reply With Quote


Bookmarks