OpenViewModal - method of object PmaPanel
The method opens viewer of another object in the modal window.
This method is obsolete (but functional), is not functional in modern Web browsers and it is better to use the Pm.CreateView method. See How to work with modal windows.
Variant OpenViewModal(String sObjectPath, [String sOptions], [String sParams], [Variant vArguments])
val = oPanel.OpenViewModal(sObjectPath, sOptions, sParams, vArguments)
| sObjectPath||(String) Path (relative or absolute) to the object or component whose viewer will be opened. |
For detailed description see sObjectPath.
| sOptions||[optional] (String) The parameters transferred to the viewer. These define where and how to open the viewer. |
Entries are in KeyVal format, for example "_blank1".
For detailed description see sOptions.
| sParams||[optional] (String) Parameters transferred to the object that is to be viewed by the corresponding viewer. |
Entries are in KeyVal format, for example "name1:value1;name2:value2;".
For detailed description see sParams.
| vArguments||[optional] (Variant) The value that is automatically passed into the Arguments property. The value of this property is typically read in the onPanelStartEnd event and it serves for passing the input data to the opened window directly in the script.|
After pressing the OK
button, the value entered in this window is returned (see the note below).
The method is synchronous, i.e. the script continues with the following statement after the modal window is terminated. For opening the viewer the permission must be set
in the opening object. For example for the PmaPanel
object: permission PanelOpen
Input and output values for modal PmaPanel
Two properties are essential for modal opening of the PmaPanel object viewer:
: Input value for opening modal vindow. This value is copied from the vArguments
parameter of this method.
: Output value defined by closing the modal window by the OK
button. In such case the value present in this property is returned as ouitput value of this method.
This concept allows to create the windows (the forms) where the panel content is not directly connected (by bindings, script) with the application, but the whole initial state of the window is passed by the input parameter and the whole state after editing the content is passed by the return value.
For passing multiple values by a single parameter the VBScript.Array function can be used.
This method is also functional in Web panels
Opens panel in a new modal window and sets both the value of the parameter nmb
of the panel and the array of 2 values in the parameter vArguments. Followed by the check, whether the modal window has transferred the reversal value (by means of the PmgRoot.ReturnValue
property) after the termination (e.g. by the OK
button). If yes, then the debug entry of this value is written into the INFO
system. This script can be, for example, in the onButtonUp
event of the PmgButton
Script calling the modal window.
var arr = Pm.CreatePmArray().Array1("text 0", 5);
var r = pMe.PmPanel.OpenViewModal("/Panel3", "", "par:nmb=2;", arr);
var a = pMe.Arguments;
pMe.Items("/text0").Value = a.GetItem(0);
pMe.Items("/text1").Value = a.GetItem(1);
var r0 = pMe.Items("/text0").Value;
var r1 = pMe.Items("/text1").Value;
pMe.ReturnValue = Pm.CreatePmArray().Array1(r0, r1);