TGML Scripting
TGML supports the script language JavaScript 1.5. A JavaScript editor is available in the Graphics Editor. You can use the JavaScript editor to access the elements and their attributes in View mode. The script engine does not run in Edit mode.
The DOM (the elements and their attributes) is accessed using DOM methods such as getCurrentTarget
, getAttribute
, and setAttribute
.
Apart from accessing the DOM, it is also possible to interact with the TGML Viewer, and thus the underlying system, using the EcoStruxure Building Operation specific JavaScript functions such as setValue
and execute
.
The execution of the scripts is event driven. Event attributes are used to specify the event and a function name. The function is executed in View mode when the specified event is raised.
For more information, see the TGML Appendix A: User-Defined Descriptions of Custom Attributes section, and the following sections: