[BUG-14211,14523] Problem with SelectedRows array

Hi to all.

I am trying to use “getSelectedRows()” in “onMousePress” extension function to get the row indexes of the selected rows in a power table. It used to work just fine in the last version of Ignition, but now, in version 8, it works like this:

As you can see, i have selected 5 rows (and i print the array each time i select a row).
The first time i select a row, i get the “array (‘i’)” and not the value; it starts saving the first row index the second time i select a row, and it doesnt save the last row index.
what is the problem here?, i have used this many times and always worked.

Thanks for reporting this, I’m able to replicate the issue here. I’ll make a ticket so we can figure out what’s going on. For reference it’s case #14211


I’m seeing the same behavior in 7.9.11; this is happening because the event is onMousePressed, which is fired before your newest selection has been made. You’ll always be one step behind, which is why you don’t have a selection in the first print statement.

Please message me directly if you’re using a script that had worked in an older version and are having issues with it in 8.0.