I have made it but with a little bit of an issue, the text field now takes a value from a power table for the first time only, and it will be same always no matter how much I close the popup or click on different rows. Except if I completely close the vision client and re-open it, then the value gets updated only with the first row clicked and it will be stuck at that value.
so here how I did it, I made a shared script as follow:
window = system.gui.getWindow(‘CMMS Main window’)
table = window.rootContainer.getComponent(‘Power Table’)
row = table.selectedRow
col = 3
value = table.data.getValueAt(row, col)
then in the text field expression I used :
try(runScript(‘call_value.getvalue’,1000), ‘no value’)
I used try() because designer will give me error when no value is selected since I am not in preview mode.
I believe the script only runs once and that’s why the value get stuck on the first time the code runs. Any work around this ?