Lyle Griess

Lyle Griess

  • NA
  • 13
  • 37.9k

how do I access an already open DHTMLX window

Oct 4 2010 3:06 PM
I need to submit a form on a dhtmlx window I've opened with a code-behind javascript.

some code:
window opener in another C# script:

            sbScript.Append("<script src='/css/dhtmlxwindows_web.css'></script> <script language=JavaScript id='Progress'>\n");
            sbScript.Append("var dhxWins= new dhtmlXWindows();");
            sbScript.Append("var id= 'Progress';");
            sbScript.Append("var url= 'Progress.aspx';");
            sbScript.Append("var win = dhxWins.createWindow(id, 10, 10, 350, 100);");
            sbScript.Append("dhxWins.window(id).progressOn();");
            sbScript.Append("dhxWins.window(id).attachURL(url);");
            sbScript.Append("</script>\n");
            Page.RegisterClientScriptBlock("Progress", sbScript.ToString());


and in another code-behind for Progress.aspx.cs:

                this.lblMessages.Text = "Processing...";
                this.panelProgress.Width = state * 30;
                this.lblPercent.Text = state * 10 + "%";
                Script += "<script language=JavaScript id='RefreshWindow'>";
                Script += "var id= 'RefreshWindow';";
                Script += "window.setTimeout('window.opener.document.Form1.submit()',100);</script>";

                Page.RegisterClientScriptBlock("RefreshWindow", Script);

Javacript error upon running this second snippet:

window.opener is null

whatever I seem to do to access the Form1 on the window and submit it doesn't seem to work:

window.document.Form1.submit();
this.window.Form1.submit();

how can I correctly submit the Form inside the DHTMLX window?

Thanks in advance....