I have a table object with a custom property called “p_data” (type String). I have that property bound to a tag that occasionally changes. In the propertychange scripting of my table I run a script that takes the values in p_data (a string array), creates a dataset and populates the table with the data. I am using the p_data property as the property that should fire the script, but it wont work. It works properly if I create a button object and fire it using the button, but I cannot get it to update using the propertychange. Any help? Here is the script:
if event.propertyName == "p_data":
inputString = event.source.p_data
if len(inputString) > 0:
a=inputString[1:-1].split(',') #Convert the input string into a list.
z=zip(a[::5],a[1::5],a[2::5],a[3::5],a[4::5],a[5::5]) #Convert resultant list into a paired list.
tableHeaders=["Event ID","Reason Code","TimeStamp","Cards","Data"]
tableData=[]
#Create data table.
for i in range(0,len(z)):
r1=int(z[i][0])
r2=int(z[i][1])
r3=int(z[i][2])
r4=int(z[i][3])
r5=int(z[i][4])
tableData.append([r1,r2,r3,r4,r5])
#Populate data table.
event.source.parent.getComponent('Table P').data=system.dataset.toDataSet(tableHeaders,tableData)
Maybe I’m just not testing it right. When in the preview mode I clear out the p_data property (the text value is empty), then I rebind the value to the tag, so it populates again. The thing is that I don’t get an error, I don’t see anything in the console - it’s like it just ignores it. I know this isn’t the case, but maybe I am doing something wrong. Thanks for any help.