IE Non-Mode Dialog (ShowModelessDialog)

zhaozj2021-02-16  56

The Non-Mode dialog is a window form of IE. After opening the Non-Mode dialog, the Motorpse window does not continue to parse its HTM code before it is turned off, and the Motorpity window will not be selected.

Maintenance window information transfer with non-mode windows

1. Function call delivery

VreturnValue = WINDOW.SHOWMODELESSDIALOG (SURL [, Varguments] [, SFEATURES])

The main adjustment window passes the parameter to the non-mode window via the second parameter Varguments of the ShowModelessDialog method, which may be an array or a DOM object.

Non-mode windows pass through Window.Dialogarguments to extract the passed parameters, if array, use Window.Dialogarguments [i] to represent the i-group IP

Non-mode windows return values ​​to the Motor window via WINDOW.RETURNVALUE. This value is received by the home adjustment window as the return value of the ShowModelessDialog method.

2. Window operation delivery

Non-mode windows pass through the Motor window to direct the elements of the main adjustment window

At this time, ShowModelessDialog needs to pass the Window object of the Motor window as a parameter. You can get the window reference of the main window window in the Non-Mode window, and you can manipulate it directly with the script.

If the call code of the main color window is as follows:

SHOWMODELESSDIALOG ("MyDialog.htm", Window, "Status: False; DialogWidth: 300px; DialogHeight: 300px; Edge: raised; ENTER: YES; Help: no; resizable: no; status: no");

Non-mode window JScript code is as follows, you can receive window objects of the main window window.

Var sdata = window.dialogarguments;

Then you can operate any variables and functions of the main adjustment window, as follows:

SDATA.SUSERNAME = 'value from modelessdialog'; // susename is a global variable for the main window

SDATA.FNUPDATE (); // fnupdate is a function of the Motor-tune window, and processes SUSERNAME variables in this function.

In this way, the main adjustment window may not obtain the numerical value set by the non-mode window by normal return value.

Remarks:

Incoming the Window object of the Motor window is a flexible operating means. But in practice, the window object can only be the Motor-tuning window, you cannot pass the Window object of other frames (non-home window) through the DOM object structure. However, in the non-mode window, according to the Window object of the incoming main window, any object is referenced to the non-maintable window through the DOM object structure.

Parameters on Non-Mode Dialogs SFEATIS

http://msdn.microsoft.com/workshop/samples/author/dhtml/refs/showmodelessdialog.htm

转载请注明原文地址:https://www.9cbs.com/read-23812.html

New Post(0)