Promotic
WikipediaLinkedInYoutubeTwitterFacebook

Preconfigurations Common modal window

Common modal window for easy addition of inputboxes.
 
This preconfiguration can be activated when creating a new object (e.g. by "New object" in the local object menu or by pressing the Insert key after selecting the object) and is included in the group: " / Panels (PmPanel) / Common inputbox".

This preconfiguration can be used with the objects: PmFolder, PmRoot, PmPanel or PmWorkspace.

 
- Preconfiguration creates an object of type PmPanel.
- The preconfiguration is created including the panel (PmPanel object) functionality as a WEB panel.
 
The OpenView method with entry parameter oExtra can be used to open the panel. See How to work with modal windows. As example the following imputboxes are included in the panel: PmiWCombo, PmiWCheck, PmiWEdit and PmiButton.

In the OK (PmiButton) button in the onStart event the entry argument values are loaded into each item. In the onButtonUp event the values from each item are merged into an array and returned back to the object, that called the OpenView method.

 
The preconfiguration of common modal window, that can be easily extended by additional inputboxes.
These configurators can be set before the preconfiguration is created:
The name of created objectName of the object created in the application object tree. This is a system name and must not contain empty string, diacritics, spaces and the first character must not be a number.

Default: "ModalDlg"

PermissionsOn this page permissions of the object are defined. See Description of the page Permissions.
Enable as WEB componentIt indicates if this object has to be registered as a WEB server component

After this preconfiguration is created, the configurator is se to: PmPanel > Web Server > Enable as WEB component.

Example:
The entry values from the val0, val1, val2 array will be displayed in the graphic items of the window. For the PmiWCombo item the index (val0) will be sent, for the PmiWCheck item the Boolean type value (val1) will be sent and for the PmiWEdit item the String type value (val2) will be sent. The array of edited values will be returned into the aResult variable.
-------------------------
An example in VBScript syntax:
Opening the preconfigured window in the panel using the onButtonUp event of the PmiButton graphic item.
Dim oExtra, val0, val1, val2
val0 = 2
val1 = true
val2 = "Promotic"
Set oExtra = Pm.CreatePmMap()
oExtra.mapSetValueAt "Arguments", Array(val0,val1,val2)
oExtra.mapSetValueAt "onClose", Pm.CreatePmAction(1, pMe, "ClosePanel")
pMe.PmPanel.OpenView "/ModalDlg", "target:_blank;modal:1;", "", oExtra
Obtaining returned value of the ClosePanel user method with parameters oSystem and oPrivate of this graphic item.
Dim aVal
aVal = oSystem.ReturnValue
If Pm.IsValid(aVal) Then
  Dim val0, val1, val2
  val0 = aVal(0)
  val1 = aVal(1)
  val2 = aVal(2)
  Pm.Debug "val0=" & val0 & ", val1=" & val1 & ", val2=" & val2
End If
-------------------------
An example in JavaScript syntax:
Opening the preconfigured window in the panel using the onButtonUp event of the PmiButton graphic item.
arr.SetItem(2, 0);
arr.SetItem(-1, 1);
arr.SetItem("Promotic", 2);
var oExtra = Pm.CreatePmMap();
oExtra.onClose = Pm.CreatePmAction(1, pMe, "ClosePanel");
pMe.PmPanel.OpenView("/ModalDlg", "target:_blank;modal:1;", "", oExtra);
Obtaining returned value of the ClosePanel user method with parameters oSystem and oPrivate of this graphic item.
var aVal = oSystem.ReturnValue;
if(Pm.IsValid(aVal))
{
  var val0 = aVal.GetItem(0);
  var val1 = aVal.GetItem(1);
  var val2 = aVal.GetItem(2);
  Pm.Debug("val0=" + val0 + ", val1=" + val1 + ", val2=" + val2);
}
 
This preconfiguration is used in PreCfg - Preconfiguration examples.
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice