You can build an event script for that table component using the mouse/mouseClicked event to do whetever you want with the row the user selected. I normally only do something if they double-click the row as it is too easy for someone to just single-click a row. Here is the script I use.
if event.button == event.BUTTON1:
if event.clickCount > 1:
GridData = event.source.data
SRow = event.source.selectedRow
PDataSet = system.dataset.toPyDataSet(GridData)
value0 = PDataSet[SRow] [0]
value1 = PDataSet[SRow] [1]
value2 = PDataSet[SRow] [2]
system.nav.openWindow("Popups/Details", {"Property0":value0, "Property1":value1, "Property2":value2})
In this example, I am only wanting the values of the first three columns in the row which the user double-clicked in the table.
The first line checks that we are only looking at button 1 on the mouse, or the left button for a right-handed user.
The second line checks that more than one click of the button happened.
The third line creates a dataset variable name GridData and copies the dataset of the table into it.
The fourth line creates a variable named SRow and sets it to the row number of the row the user double-clicked.
The fifth line creates a PyDataset variable named PDataSet, converts the dataset in GridData to a PyDataset, and assigns it to PDataSet.
The sixth, seventh and eighth lines create three variables named value0, value1, and value2 and assigns the value of column zero in the selected row of the PyDataSet to value0, the value of column one to value1, and the value of column two to value2.
The ninth line, in this example, opens a popup window named Details in the Popups folder, that has three previously assigned custom properties named Property0, Property1, and Property2, and passes the value of value0 to Property0, value1 to Property1, and value2 to Property2.
These three values can be used in the popup window to display the contents of the first three columns of the selected row in the table. If all you need is the primary key from the selected row, you would only need a value0 and a Property0. If you added a dataset property to the custom properties of the popup window, then you could use Property0 in a SQL query bound to that dataset to pull in the entire record of data for the selected row with a query such as…
SELECT * FROM MyTable WHERE PKey = {Root Container.Property0}
where PKey is the name of the primary key field in a table named MyTable. Now you have the entire record of data in that dataset in your popup window and can do with it as you please.
If any of this is not clear, let me know and I’ll explain further. My technical writing skills are not the best in the world.