The modal window is usually used for data entry (editing). The user is entering the entries and before the proces is completed the user is prevented from "leaving the window".
While the modal window is open, access the rest of the application is blocked, therefore it is necessary to think well before using such window. It is recommended to use such window only for simple data entry so it is not open for a long time.
var aArgm = pMe.Arguments;
pMe.Items("/WCombo").SelectedIndex = aArgm.GetItem(0);
pMe.Items("/WCheck").Value = aArgm.GetItem(1);
pMe.Items("/WEdit").Value = aArgm.GetItem(2);
if (pEvent.Reason == "ok")
var v1 = pMe.Items("/WCombo").SelectedIndex;
var v2 = pMe.Items("/WCheck").Value;
var v3 = pMe.Items("/WEdit").Value;
var aVal = Pm.CreatePmArray().Create(3);
aVal.SetItem(v2 = v2 ? -1 : 0, 1);
pMe.ReturnValue = aVal;
Create the oExtra variable representing the PmMap type object and then:
Then the modal window is opened. Once the window is closed its value is processed in the "ClosePanel" method.
var arr = Pm.CreatePmArray().Create(3);
var oExtra = Pm.CreatePmMap();
oExtra.Arguments = arr;
oExtra.onClose = Pm.CreatePmAction(1, pMe, "ClosePanel");
pMe.PmPanel.OpenView("/ModalDlg", "target:_blank;modal:1;", "", oExtra);
Obsolete and therefore not recommended approach of modal window opening by the OpenViewModal method. If this method is used then the modal window is opened synchronously and therefore the script waits until the window is closed by the user. If the window is enabled as Web component, then problems may occure since some Web browsers do not support such approach (Chrome, Opera).