ShowModalDialog and ShowModelessDialog use experience

xiaoxiao2021-03-06  99

ShowModalDialog and ShowModelessDialog use experience

1. What is the difference between SHOWMODALDIALOG and ShowModelessDialog?

ShowModalDialog: The input focus will always be kept after being opened. Users cannot switch to the main window unless the dialog is turned off. Similar to the operation of Alert.

SHOWMODELESSDIALOG: After being opened, the user can randomly switch the input focus. There is no impact on the main window (most is blocked, and it is: p)

Second, how can I make the SHOWMODALDIALOG and SHOWMODELESSDIALOG's super connection not pop up a new window?

Plus and .

Third, how do you only refresh the contents of ShowModalDialog and ShowModelessDialog?

In ShowModalDialog and ShowModelessDialog, you cannot press F5 to refresh, and you can't pop up menu. This can only rely on JavaScript, the following is related code:

reload ...

Replace FileName.htm with the name of the web page and put it in your open page, press F5 to refresh, pay attention, this is to cooperate with , otherwise you will press F5 to pop up new Window.

Fourth, how to turn off the window opened with SHOWMODALDIALOG (or ShowModelessDialog) with JavaScript.

Also together with

5. ShowModalDialog and ShowModelessDialog Data Transmission Skills.

(Author: I originally wanted to use a question and answer form, but I can't ask how to ask this, so I have this.)

This thing is more troublesome, I have changed several times, I don't have no way to understand (the language level is getting worse), I have to use an example.

example:

Now you need to read or set a variable var_name in a showmodaldialog (or showmodelessdialog)

General transmission mode:

Window.ShowModalDialog ("FileName.htm", Var_name)

// Pass the var_name variable

Read and set in ShowModalDialog (or ShowModelessDialog):

Alert (window.dialogarguments) // reads var_name variables

Window.dialogarguments = "ioiboy" // Sets var_name variables

This approach is satisfied, but when you want to operate the second variable virtue var_id at the same time? It is no longer possible to operate. This is the limitations of this transmission method.

The following is how I recommend it:

Window.ShowModalDialog ("FileName.htm", Window)

/ / No matter what variable to operate, only pass the Window object of the main window.

Read and set in ShowModalDialog (or ShowModelessDialog):

Alert (window.dialogarguments.var_name) // reads var_name variables

Window.Dialogarguments.var_name = "ioiboy" // Sets var_name variables

At the same time, I can also operate the var_id variable.

Alert (window.dialogarguments.var_id) // reads var_id variables

Window.Dialogarguments.var_id = "001" // Sets var_id variable

You can also operate any object of the main window, such as the element in the form object.

Window.Dialogarguments.form1.index1.value = "This is the value of the INDEX1 element"

Sixth, multiple ShowModelessDialog interoperability.

Because the light said is very hard, I will peek, I will use the code directly. If I don't understand, I will be directly letted (Oyiboy # 163.net (please send # @@) when using it..

The main role of the following code is to move a showmodelessDialog in a showmodelessdialog.

Site JS code for the main file.

VAR S1 = ShowModelessDialog ('' Control .htm '', Window, "Dialogtop: 1PX; Dialogleft: 1PX") // Open Control Window

Var S2 = ShowModelessDialog ('' About: Blank '', Window, "Dialogtop: 200px; Dialogleft: 300px") // Open the control window

Control the part of the .htm.