Does anyone know why this code does not work to expand a specific path on a tree view? I do not get an error, but is also does nothing to the tree view on the window.
treeView = event.source.parent.getComponent('Tree View')
def expandNode(node, listPath):
if(len(listPath) > 0):
for childIndex in range(0, node.getChildCount()):
child = node.getChildAt(childIndex)
if(child.toString() == listPath[0]):
print "expand node %s" % (child)
treeView.expandNode(child, True)
if(len(listPath) > 1):
expandNode(child, listPath[1:])
expandNode(treeView.model.root, ["East Area", "Process", "Valve1"])