Issue
String comparison in TGML script is not working.
Product Line
TAC Vista
Environment
TGML graphics editor 1.1.X
Cause
Javascript has a string class and a string literal. String literals are denoted by double or single quotation marks ("" or '') and it is important to compare "like" with "like".
String literal: string1 = "Apples"
String class: string1 = target.getAttribute("Name");
Resolution
A deeper comparison is required in the example below. Instead of:
name = target.getAttribute("Name"); tmp = target.getParentNode().getElementsByTagName("Ellipse").item(i).getAttribute("Name"); if (tmp==name)
Use:
if (tmp.equals(name))
An example is shown in the TGML graphic attached. Download graphic
Also check out the JavaScript Essentials - Episode 3 - Value Types Quick-Help video on the Exchange.