Window with data details linked from table

I apologize if this is covered somewhere, but I’ve not done a whole lot with the Vision side of Ignition, and I am trying to figure out how to go about this… I want to have a window with a table showing some of the columns of data from a SQL table and then make the serial number in each row clickable (a link or action) to switch to a window which has all the data (from multiple SQL tables) on that one part. Can anyone point me to an article or give me some steps for this? I have the basic table, but can’t figure out what to do next.

On the second window create a custom property on the root container called ID of type Integer
Then on the first window power table, go into scripting, under Extension Functions edit onDoubleClick
Add code like

	if colIndex==0:
		param1 = value
		window = system.nav.openWindow('SecondWindowName', {'ID' : param1})

This will open the second window when the ID column of the table is double clicked, passing the ID value to the window.
Then in the data source for the second window tables, pass the root container ID variable in the where clause.

1 Like

This works great! One thing that got me at first - if ID is a hidden column, it still counts and is sent. I was thinking it was the first displayed column and was getting no results on my second page. Here is my SQL (for reference for others):

SELECT CoverBarcode
FROM ClutchData
WHERE ID = {Root Container.ID}

The only thing that is acting oddly that I haven’t solved is the button bar on the left which uses a tab strip - it doesn’t notice I changed windows, and to go back to the table, I have to click another button and then click the button of the table.

Anyone know how to make the tab strip navigation notice the screen change? Or, is there a Back button I can add, to revert back?

You could write to the tab control in the code above and select the other tab

Any examples for that?

system.gui.getWindow("NameOfWindowWithTabsOnIt").rootContainer.getComponent('NameOfTabControlToModify').selectedTab = "NameOfTabToSetSelectedTo"

1 Like

Did the trick! Thanks!!