Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Work Tasks

Hierarchy Selector Widget Properties Usage

  • Last UpdatedNov 15, 2023
  • 3 minute read

The following sections describe how the Hierarchy Selector widget properties are used in the configuration file.

Data

This property is defined as a function and this is called for incoming data.

Embedded Image (65% Scaling) (LIVE)

Incoming data is handled through the defaultNodesMapping, nodesMapping, and nodesValue sections in the configuration file.

The dataset you are using needs to follow the nodesValue structure. If there are changes to the nodesValue properties, you need to update the nodesMapping properties to match those changes. If there are no changes, then you can remove the nodesMapping section from your script. The configuration file will then use the defaultNodesMapping settings.

Under the nodesValue section in the following screenshot is the example data structure that the widget recognizes.

The entire tree structure needs to be passed to the widget and is not necessarily built as you select node.

Embedded Image (65% Scaling) (LIVE)

Selected Object and Selected Value

These properties are defined in the configuration file for outgoing data with the selectedChildNode function. For example scripts see Pass Data to and from Widget.

Select Node

This property is used to take an object with any number of property value pairs for comparison. Using this property, you can set a default value or persist a node selection in a hierarchy.

Note: The On Selection Change event is triggered when the same node is selected through this property. This is because before selecting a child node, its parent node is selected first, where null is omitted. After that, the child node that you want is selected. So on each API call, if there's a matching node, there are two On Selection Change events received.

API parameter:

{

childNode:{

property1:value1,

property2:value2,

:

}

}

Example

control.findByXmlNode("Widget1").widgetProperties.selectNode = JSON.stringify(

{

childNode:{

reasonGroupID : 15,

reasonID: 20,

}

});

Validation scenarios

There are scenarios where the Hierarchy Selector widget doesn't work as expected, which includes the following:

  • If a node selection cannot be found, an error is thrown in the console log. No error is shown in the UI and no error code is returned.

  • If the childNode parameter isn't defined correctly, an error is thrown in the console log.

    For example:

    control.findByXmlNode("Widget1").widgetProperties.selectNode = JSON.stringify(

    {

    childNode123:{

    reasonGroupID : 15,

    reasonID: 20,

    }

    });

  • If the childNode value is null or empty, or isn't an object (such as numeric value), an error is thrown in the console log.

    For example:

    control.findByXmlNode("Widget1").widgetProperties.selectNode = JSON.stringify(

    {

    childNode:null

    });

    or

    control.findByXmlNode("Widget1").widgetProperties.selectNode = JSON.stringify(

    {

    childNode:{ }

    });

    or

    control.findByXmlNode("Widget1").widgetProperties.selectNode = JSON.stringify(

    {

    childNode:5

    });

  • Error without calling JSON stringify (UI error)

    For example:

    control.findByXmlNode("Widget1").widgetProperties.selectNode =

    {

    childNode:{

    reasonGroupID : 15,

    reasonID: 20,

    }

    };

TitleResults for “How to create a CRG?”Also Available in