system.nav.openWindowInstance
returns a reference to the newly opened window, use that reference instead of calling system.gui.getWindow
, like such:
targetWindow = system.nav.openWindowInstance("Popup windows/Loft/DrumInspectionScreen")
Additionally, don't write to and then read from the same tag in the same script. Use variables to store temporary data, that's what they do. The assignment to drumno.selectedIndex
can be simplified to drumno.selectedIndex = value - 1
, and the call to system.tag.readBlocking
can be removed.
Overall your code can be simplified to the following (with more descriptive names for the variables):
def onDoubleClick(self, rowIndex, colIndex, value, event):
if rowIndex == -1:
return
tableData = self.data
firstColValue = tableData.getValueAt(rowIndex, 0)
system.tag.writeAsync(["[client]ScadaNavigation/DrumSelectLime"], [firstColValue])
newPopup = system.nav.openWindowInstance("Popup windows/Loft/DrumInspectionScreen")
drumNoComponent = newPopup.getComponentForPath("Root Container.lbo_Drums")
drumNoComponent.selectedIndex = firstColValue - 1
Side note: Pictures are great for context, but post code as preformatted text. It makes it easier for others to parse and allows copy/paste instead of trying to decipher a picture. Please see Wiki - how to post code on this forum. You can edit your post by clicking the pencil icon in the bottom right.
EDIT: Added cleaned code, corrected selectedIndex
assignment example