IE non-modal dialog box (showmodelessdialog) application

Source: Internet
Author: User
Tags array variable
model| dialog Box Modeless dialog box is a window form of IE, open the modeless dialog box, before it is closed, the keynote window will not continue to parse the subsequent HTM code, and the keynote window will not be selected.
The message transmission between the keynote window and the Non-modal window
1. Function Call delivery method
Vreturnvalue = Window.showmodelessdialog (sURL [, varguments] [, Sfeatures])

The keynote window passes the argument to the modeless window through the second parameter of the showModelessDialog method, which can be an array or a DOM object.
The modeless window extracts the passed arguments by window.dialogarguments, or, if the array, uses window.dialogarguments[i] to represent the first parameter of the array.
The modeless window returns a value to the keynote window by Window.returnvalue, which is received as the return value of the showModelessDialog method by the keynote window.

2. How window operations are delivered
Non-modal windows are passed through the keynote window object directly manipulating the elements of the keynote window
At this point, showModelessDialog needs to be the window object of the keynote windows as a parameter, in the modeless window can get the window of the Keynote window reference, with the script can directly manipulate it.

The calling code for the keynote window is as follows:
showModelessDialog ("mydialog.htm", Window, "status:false;dialogwidth:300px;dialogheight:300px;edge:raised"; Enter: Yes; Help:no; Resizable:no; Status:no ");

The modeless window has the following JScript code to receive the Window object of the keynote window
var sData = window.dialogarguments;

You can then manipulate any of the variables and functions of the keynote window as follows:
Sdata.susername = ' Value from Modelessdialog '; sUserName is the global variable of the keynote window
Sdata.fnupdate (); Fnupdate is the function of the keynote window, in which the sUserName variable is processed

In this way, the keynote window can get the value of the modeless window set without the normal return value.

Note:
Passing the Windows object of the keynote window to the modeless window is a very flexible way to operate. But in practice, the Window object can only be the keynote window itself, you can not through the DOM object structure, other frames page (not the keynote window) of the Window object passed in. In a non-modal window, however, you can refer to any object in a non-keynote window by using the DOM object structure, depending on the window object of the incoming keynote.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.