Promotic

CreateItem - method of the PmForm object

Description:
Creates a single form item.
Syntax:
Object CreateItem(String sType, [String sId], [String sTitle], [String sProps], [String sPars])
Parameters:
sType(String) Pmf object type. Based on this type the corresponding object is created.
This value can later be detected by means of the PmfObject.Type property.
"string" - Creates object PmfString = Text input
"number" - Creates object PmfNumber = Integer or real number input
"bool" - Creates object PmfBool = Boolean value input item (Checkbox)
"enum" - Creates object PmfEnum = Selection of one of multiple items (Combobox)
"button" - Creates object PmfButton = Button
"layout" - Creates object PmfLayout = Area for other Pmf objects
"separ" - Creates object PmfSepar = Separator between configurators
"table" - Creates object PmfTable = Table
"tree" - Creates object PmfTree = Tree
sId[optional] (String) Pmf object identifier.
Identifier can be used for example for obtaining the Pmf object by the GetItem method or for testing in the oExtra.onChange event.
If the identifier is not defined or has the value null then it is not possible to refer to this object.
This value can later be detected by means of the PmfObject.Id property.
sTitle[optional] (String) Displayed name of the Pmf object.
The name is by default displayed to the left of the configurator.
If needed, then the system adds "colon" character to the name.
If the name is an empty string then it is not displayed, but its area is allocated (the TitlePos property is unchanged).
If name is not set or has the value null then it is not displayed and its area is not allocated (simultaneously the the TitlePos property is set to "no").
This value can later be detected or modified by means of the PmfObject.Title property.
sProps[optional] (String) Initial values of properties of the created object. The syntax of this parameter is "PropertyName:Value;...". Entries are in the KeyVal format.
For example when creating the PmfNumber object can be entered: "Min:0;Max:100;"
sPars[optional] (String) Parameters of created Pmf object. Define where the object will be created. "parent:$sys;pos:after=xy". Entries are in the KeyVal format.
parent:id - Specifies in which PmfLayout object the object will be created.
The default value is $main.
pos:before=id - Create the object in front of the object created previously with id identifier.
pos:after=id - Create the object behind the object created previously with id identifier.
pos:first - Insert the object as first.
pos:last (default) - Insert the object as last.
Note:
This method is also functional in Web panels.
See also:
- PmForm.GetItem (method)
Example1:
JavaScriptSelect and copy to clipboard

var oString = oForm.CreateItem("string", "IdStr", "Title", "Value:value");

History:
Pm8.03.08: Created
PROMOTIC 9.0.27 SCADA system documentation MICROSYS, spol. s r.o.

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