Invoking a PopUp

To invoke a PopUp:

  1. In the Graphics Editor, drag and drop any component onto the workspace.
  2. Drag the PopUp snippet onto the component in the workspace, and then save the file.
  3. The following code example details the code to invoke a PopUp.

Copy
functionclick(evt)
{
    //componentName is the name of the component, based on the component selection we will fetch the component name
    var componentName = evt.getCurrentTarget().getAttribute("Name");
    //Collecting the links from the component
    var Link = evt.getCurrentTarget().getElementsByTagName("Link");
    //InstanceID is auto generating id, each component pop up selection it will create new instance id
    var instanceId = evt.getCurrentTarget().getAttribute("InstanceId"); //GUID
    //title is the component name used for showing the title
    var title = componentName;
    //customExpose is used if two breakers are internally connected (refers to multi-equipment)
    var customExpose = evt.getCurrentTarget().getAttribute("SubstituteNames");
    //Height & width can be configurable by the user
    var width = 370;
    var height = 370;
    //showTitleBar displays the Title Bar in the target pane when set to "Yes"
    var show TitleBar = "Yes";
    for (var i=0;i< Link.length;i++) {
        //LinkFileName refers to extracting the file name from the Link
        var LinkFileName  = Link.item(i).getAttribute("Name");
        //With the invoke function you can configure the graphic component in Graphics Editor to open a linked target object in a target location when you perform an action (PopUp) on the component
        invoke(LinkFileName, "Type = PopUp | ComponentName =" + componentName + " | InstanceID=" + instanceId + " | Title =" + title + " | Width=" + width + " | Height=" + height + " 
        | ShowTitleBar =" + showTitleBar + " | CustomExpose=" + customExpose);
    }
}

function load(evt)
{
}

For more details see the Script API snippets and the TGML snippet example prerequisites.