Hi All,
So, I have a west navigation pane that I want to put an active or “dynamic” tree into. I’m thinking I can populate the tree table with having two custom datasets in my root container, one being the main window dataset with an extra column to define when it should go into the other dataset that the tree view pulls from. the active table should change with changing of text in a label. Anyway, here is my code, and the error its throwing when i try and run it. It allows to save, but crashes when I actually change the label text.
[code]if event.propertyName ==“text”:
table = event.source.parent.getComponent("Table")
test1 = event.source.parent.getComponent("activeWindows")
pyData = system.dataset.toPyDataSet(table)
headers = ["path","text","icon","background","foreground","tooltip","border","selectedText","selectedIcon","selectedBackground","selectedForeground","selectedTooltip","selectedBorder"]
newData = []
for x in range(len(pyData)):
if (pyData[x][0]== event.source.parent.getComponent("Location").text):
row = [pyData[x][1],pyData[x][2],pyData[x][3],pyData[x][4],pyData[x][5],pyData[x][6],pyData[x][7],pyData[x][8],pyData[x][9],pyData[x][10],pyData[x][11],pyData[x][12],pyData[x][13]]
newData.append(row)
test2 = system.dataset.toDataSet(headers,newData)
test1.data = test2[/code]
and this is throwing this error at runtime:
Traceback (most recent call last):
File “event:propertyChange”, line 15, in
AttributeError: ‘NoneType’ object has no attribute ‘data’
Ignition v7.5.4 (b1206)
Java: Sun Microsystems Inc. 1.6.0_34
any help appreciated!