Promotic
WikipediaLinkedInYoutubeTwitterFacebook

Example: Creates items for data entry in the PmgForm object

In the script in the PmgForm.onFormLoad event a form is created:
JavaScriptSelect and copy to clipboard

function onEAccept(ev)
{
if (oEnum1.Value == 9.9)
oStr1.Value = "fast - Packed water";
}


function onReset(ev)
{
if (ev.Action == "main")
{
oNmb1.Value = 5;
oBool1.Value = true;
oEnum1.Value = 0.5;
oStr1.Value = "Packed water";
}
}

//Creates a form object
var oForm = pMe.Form;
oForm.Title = "Package storage parameter input box";

//Creates form items (Pmf objects):

//PmfNumber
var oNmb1 = oForm.CreateItem("number", "n1", "Number of packages", "Min:0;Max:33;");
oNmb1.Value = 5;

//PmfBool
var oBool1 = oForm.CreateItem("bool", "b1", "Store");
oBool1.Value = true;

//PmfEnum
var oEnum1 = oForm.CreateItem("enum", "e1", "Processing speed");
oEnum1.AddRow(0.5, "slow");
oEnum1.AddRow(9.9, "fast");
oEnum1.Value = 0.5;
oEnum1.AddEvent("onEditAccept", onEAccept);

//PmfString
var oStr1 = oForm.CreateItem("string", "s1", "Description");
oStr1.Value = "Packed water";

//PmfButton
var oBtn1 = oForm.CreateItem("button", "reset", "Zero in");
oBtn1.Value = "Reset";
oBtn1.AddEvent("onAction", onReset);
PROMOTIC 9.0.13 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice