Promotic
WikipediaLinkedInYoutubeTwitterFacebook

Opening the viewer of the PmForm object (/#glob/form)

The viewer of the PmForm object is opened by the Pm.CreateView method. In the parameter sViewPath the global path "/#glob/form" is entered.
Viewer parameters:
onLoad[optional] (Function) The event function for managing the event of viewer creation.

For JavaScript the object function is entered.

For VBScript the object PmAction is entered.

The function has a single parameter ev containing information regarding the corresponding event.

ev.Form - (PmForm) The PmForm object that is being viewed.
onOpen[optional] (Function) The event function for managing the event of viewer opening.

For JavaScript the object function is entered.

For VBScript the object PmAction is entered.

The function has a single parameter ev containing information regarding the corresponding event.

ev.Form - (PmForm) The PmForm object that is being viewed.
onChange[optional] (Function) The event function for managing the event of viewer modification.

For JavaScript the object function is entered.

For VBScript the object PmAction is entered.

The function has a single parameter ev containing information regarding the corresponding event.

ev.Form - (PmForm) The PmForm object that is being viewed.
ev.ItemId - (String) Pmf object identifier.
ev.ChangeType - (String) Modification type identifier.
- "value": Some object value has been changed.
- "push": Some item has been pressed. It is functional only for PmfButton item type.
ev.NewValue - (Variant) Item value after change.
ev.OldValue - (Variant) Item value before change.
onClose[optional] (Function) The event function for managing the event of viewer closing.

For JavaScript the object function is entered.

For VBScript the object PmAction is entered.

The function has a single parameter ev containing information regarding the corresponding event.

ev.Form - (PmForm) The PmForm object that is being viewed.
ev.CloseReason - (String) Identifier of window closing type. Value of the identifier depends on which button has been used to close the viewer.See PmForm.SysButtons and PmForm.Close.
The viewer parameters are in the form of the PmMap object that is filled from value of the sView parameter (of the KeyVal type) in the Pm.CreateView method.

By filling from the KeyVal value all the parameters are initially stored as string. The content of the PmMap object can be then modified as needed - the items can be modified, added and deleted.

The PmMap object can also contain other embedded PmMap objects (Submap). The PmMap.mapSetSubmapAt method can be used in order to create a new PmMap or make one accessible.

Example:
JavaScriptSelect and copy to clipboard

var oNmb1;

function onViewLoad(ev)
{
var oForm = ev.Form;
oForm.Title = "Setting";

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

oForm.AddEvent("onClose", onViewClose);
}


function onViewClose(ev)
{
if (ev.CloseReason == "ok")
Pm.Debug(oNmb1.Value);
}

var oCreator = Pm.CreateView(pMe.PmPanel, "/#glob/form", "", "target:_blank;modal:1;");
oCreator.View.onLoad.onLoad = onViewLoad;
oCreator.Open();

History:
Pm9.00.09: Created
PROMOTIC 9.0.9 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