Promotic

onFormLoad - event of the PmgForm object

Description:
The event is triggered when initializing the PmgForm object.
It is a suitable place for creating the form items (for example by calling the PmForm.CreateItem method).
 
The event is triggered immediately after the event onStart is finished. The onStart events of the subsequent Pmg objects are not yet triggered.
Parameters:
pMe(Object) Reference to the PmgForm object where the event rises.
Example:
Example of creating a form with items of various data types.
JavaScriptSelect and copy to clipboard

var oForm = pMe.Form;
oForm.Title = "PmForm";
oForm.BgColor = "#c0dcc0";

oForm.CreateItem("separ", "id_separ_1", "Text separator 1", "Subtype:line;");

var oInt1 = oForm.CreateItem("number", "id_nmb_1", "Int 1", "Subtype:int;Min:0;Max:5;");
oInt1.Value = 2;

var oFloat1 = oForm.CreateItem("number", "id_nmb_2", "Float 1", "Subtype:float;Min:0;Max:10;");
oFloat1.Value = 2.6;

var oString1 = oForm.CreateItem("string", "id_str_1", "String 1", "");
oString1.Value = oForm.ClientType ? "PM Runtime" : "PM Develop";

var oBool1 = oForm.CreateItem("bool", "id_bool_1", "Bool 1", "");
oBool1.Value = true;

var oEnum1 = oForm.CreateItem("enum", "id_enum_1", "Enum 1", "");
oEnum1.AddRow(0.5, "slow");
oEnum1.AddRow(9.9, "fast");
oEnum1.Value = 0.5;

oForm.CreateItem("separ", "id_space_1", "", "Subtype:space;");
oForm.CreateItem("separ", "id_separ_2", "Text separator 2", "Subtype:line;");

var oString2 = oForm.CreateItem("string", "id_str_2", "String 2", "Multiline:1;");
oString2.Value = "row 0\r\nrow 1";
PROMOTIC 9.0.22 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.