Table clearing error

When trying to clear the selection on a table in Perspective, I am getting the error below. Does anyone know if this is a bug with the software? (using version 8.1.19 here)

13:24:33.701 [Browser Thread: 57184] ERROR Perspective.Designer.Workspace - level: LEVEL_ERROR
message: “onerrorLogger: {"stack":"TypeError: Cannot read property 'Line_Path' of undefined\n at f (http://srv14aigd02.netit.itc.com/res/perspective/js/PerspectiveComponents.c3ea7dac07ea01633e2b.js:2:1381080)\n at Object.m [as getCellValue] (http://srv14aigd02.netit.itc.com/res/perspective/js/PerspectiveComponents.c3ea7dac07ea01633e2b.js:2:1381132)\n at http://srv14aigd02.netit.itc.com/res/perspective/js/PerspectiveComponents.c3ea7dac07ea01633e2b.js:2:1327611\\n at Array.reduce ()\n at D.getAllRowData (http://srv14aigd02.netit.itc.com/res/perspective/js/PerspectiveComponents.c3ea7dac07ea01633e2b.js:2:1327588)\n at D.handleSingleSelection (http://srv14aigd02.netit.itc.com/res/perspective/js/PerspectiveComponents.c3ea7dac07ea01633e2b.js:2:1350610)\n at D.handleBodyClick (http://srv14aigd02.netit.itc.com/res/perspective/js/PerspectiveComponents.c3ea7dac07ea01633e2b.js:2:1346100)\n at Object.ki (http://srv14aigd02.netit.itc.com/res/perspective/js/react-dom-16.14.0.js:176:167)\n at ji (http://srv14aigd02.netit.itc.com/res/perspective/js/react-dom-16.14.0.js:13:49)\n at mi (http://srv14aigd02.netit.itc.com/res/perspective/js/react-dom-16.14.0.js:13:103)","message":"Cannot read property 'Line_Path' of undefined","name":"TypeError","logData":{"msg":"Uncaught Exception","errorMsg":"Uncaught TypeError: Cannot read property 'Line_Path' of undefined","url":"http://srv14aigd02.netit.itc.com/res/perspective/js/react-dom-16.14.0.js\",\"line number":32,"column":337}}”
line_number: 2
source: “http://srv14aigd02.netit.itc.com/res/perspective/js/PerspectiveClient.fd30fcd8486628b272de.js

13:24:33.701 [Browser Thread: 57184] ERROR Perspective.Designer.Workspace - level: LEVEL_ERROR
message: “Uncaught TypeError: Cannot read property 'Line_Path' of undefined”
line_number: 32
source: “http://srv14aigd02.netit.itc.com/res/perspective/js/react-dom-16.14.0.js

post your script, here are some hints from your error message

Cannot read property 'Line_Path' of undefined
...
"line number":32,"column":337}}”
...

At the point this is firing, there is no logic pointed at or using those properties.

There are no event scripts associated to this error. This happens by simply clicking on the table or surrounding flex container.

It feels like its inherent to the table object, but could be inherent to its container.

Is this in the designer or a perspective session?

Both

The errors shown in your post all occur in a Java Script file, so those at least are from the component. However, this doesn’t look like the full stack trace.

I would expect a “caused by” statement at some point.

The error information gathered above is from the designer. I cleared everything in my logs before attempting to deselect a row on a table. Everything I posted above is what Ignition applied to the logs.

The error information gathered above is from the designer. I cleared everything in my logs before attempting to deselect a row on a table. Everything I posted above is what Ignition applied to the logs.

Just attempted the same functionality with a new button using its click event and this logic. I am still receiving the same error.

self.parent.parent.getChild(“flxCntTables”).getChild(“flxCntInput”).getChild(“flxCntBody”).getChild(“Table”).props.selection.selectedRow = None

I wasn’t able to reproduce any error. However, I also wasn’t able to clear the selection from a table using a script.

I would expect setting the selectedRow to -1 to work, however, the selection just stays. I also tried clearing the selection data array, but that also didn’t clear the highlighted row.

I just added a table and a button to a view and added this script to the actionPreformed event of the button.

self.getSibling("Table").props.selection.selectedRow = -1

Perhaps @cmallonee has some insight into how to properly clear selected rows from a table component.

I don’t seem to get any errors when I fire the following code form the onClick event from a button, and it seems to deselect everything:

	self.getSibling("Table").props.selection.selectedColumn = None
	self.getSibling("Table").props.selection.selectedRow = None
1 Like

I don’t believe this is a bug, I would look at the Event Configuration for the root container, and see if there is some erroneous code causing the issue.

Could you please supply the code you are using to “clear the selection” when this occurs? We’re all just guessing until we see how you’re clearing the selection data in the first place.

Deselecting the column was what I was missing. Not sure why I didn’t think of that, lets chalk it up to lack of sleep.

self.getSibling("Table").props.selection.selectedRow = -1
self.getSibling("Table").props.selection.selectedColumn = -1
1 Like

Something that happens to me every now and then in Perspective is right clicking over an unselected component, and then, as a consequence, I end up writing a script in a different component than I intended to [the component that was actually selected]. To me, this scenario seems feels like the aforementioned situation. It feels like a script has been inadvertently written to the wrong place, and these errors are the unintended consequence.

At the moment, if you need to clear selection, just set both the selectedColumn and selectedRow properties to None or null. Currently, the selection data is intended to be read only. It looks like by clearing it, we might be interfering with some internal book keeping of selection data. We will look into it, but for now all you need to do is set selectedColumn and selectedRow to null, and the Table will clear the selected data for you.

3 Likes

Thanks for the feedback. I had a colleague mention the same thing as well. Much appreciated.