Hi team,
I’m using an embedded view with a dropdown inside a Perspective table column. When I attach a script to the dropdown’s onActionPerformed event, the Gateway logs an error during execution. I’ve verified the dataset tag path and parameters, but the issue persists. Any guidance would be appreciated. This stopped the other buttons’ function also.
def runAction(self, event):
#self.getSibling("Label").props.text= str(self.view.params.column)
tagPath = "[default]ds_cutlist"
rowIndex = self.view.params.rowIndex
columnName = self.view.params.column
Thanks in advance.
It looks like you have a data key that begins with a number (1st). Those are not valid and can be problematic.
I’ve checked further, and the same issue also occurs when clicking the embedded view button that moves the current row one step up.
def runAction(self, event):
# Compose message based on action
tagPath = "[default]ds_cutlist"
rowIndex = self.view.params.rowIndex
if rowIndex <= 0:
return
# Read dataset
ds = system.tag.readBlocking([tagPath])[0].value
pyDS = system.dataset.toPyDataSet(ds)
rows = [list(row) for row in pyDS]
if rowIndex >= len(rows):
return
rows[rowIndex - 1], rows[rowIndex] = rows[rowIndex], rows[rowIndex - 1]
headers = list(ds.getColumnNames())
newDs = system.dataset.toDataSet(headers, rows)
system.tag.writeBlocking([tagPath], [newDs])