I am trying to set up a button on an embedded view that I have in a template repeater, that will then do an array.remove() on the instances property of the flex repeater.
the error I am getting look like it can’t match up the element params, with the params in the view.
Event Script on the button in the embedded view
system.perspective.sendMessage('removeListItem', {'listItem':self.view.params})
Message handler script on the flex repeater
from com.inductiveautomation.ignition.common import TypeUtilities
listItem = TypeUtilities.pyToGson(payload['listItem'])
instances = TypeUtilities.pyToGson(self.props.instances)
instances.remove(listItem)
The error I am getting
com.inductiveautomation.ignition.common.script.JythonExecException
Traceback (most recent call last):
File "<function:onMessageReceived>", line 5, in onMessageReceived
ValueError: array.remove({"alarm":false,"analogParams":{"formatString":"#,##0.#","tagPath":"[CarefreeSCADA]Customers/Demo/reservoir/Reads/Well_Flow","name":"Well Flow","engUnits":"gpm"},"analyticsParams":{"calcDuration":24,"dataAggregation":"Average","enabled":false},"instancePosition":{},"instanceStyle":{"classes":""},"popup":true}): {"alarm":false,"analogParams":{"formatString":"#,##0.#","tagPath":"[CarefreeSCADA]Customers/Demo/reservoir/Reads/Well_Flow","name":"Well Flow","engUnits":"gpm"},"analyticsParams":{"calcDuration":24,"dataAggregation":"Average","enabled":false},"instancePosition":{},"instanceStyle":{"classes":""},"popup":true} not found in array
caused by org.python.core.PyException
Traceback (most recent call last):
File "<function:onMessageReceived>", line 5, in onMessageReceived
ValueError: array.remove({"alarm":false,"analogParams":{"formatString":"#,##0.#","tagPath":"[CarefreeSCADA]Customers/Demo/reservoir/Reads/Well_Flow","name":"Well Flow","engUnits":"gpm"},"analyticsParams":{"calcDuration":24,"dataAggregation":"Average","enabled":false},"instancePosition":{},"instanceStyle":{"classes":""},"popup":true}): {"alarm":false,"analogParams":{"formatString":"#,##0.#","tagPath":"[CarefreeSCADA]Customers/Demo/reservoir/Reads/Well_Flow","name":"Well Flow","engUnits":"gpm"},"analyticsParams":{"calcDuration":24,"dataAggregation":"Average","enabled":false},"instancePosition":{},"instanceStyle":{"classes":""},"popup":true} not found in array
Ignition v8.1.0-rc1 (b2020091420)
Java: Azul Systems, Inc. 11.0.7