In my scripted module, I have two mrml table nodes saved as variables. When data is loaded from a server, the table nodes are modified and the changes are displayed. This works normally until the user switches to another module and back to my module. The table nodes still exist inside slicer; however, the table displays no data and the table views’ table node is set to None. The code can for table node creation and connection to the table view can be found here.
My first question is this intended functionality or is the way I am using table nodes incorrect?
I was able to find a workaround for this issue by using the enter function to reconnect the table node to the table view. Assuming the interaction described above is intended, is this the proper way to handle table node re-connection?
Below is a small script you can run to reproduce this issue.
The syntax could be a bit simpler, but the mrmlTableViewNode method was not exposed in the table widget. I’ve updated the Python wrapping and from tomorrow this will work, too (in Slicer Preview Releases):