Hi All,
Want to get a better understanding on how TreeControls exactly work. I've managed to get what I want working but not how I expected.
For me to get TreeControls to work I do they following.
- Create one table to gather all the data (SNMP) for example.
- Crete a second table that I fill using the data gather from the first table with a QAction
*********************************************************************************
To help me get a better understanding I created the most basic driver. This driver has two tables. Table 100 which has a device name (Primary Key) and a second table 200 with a foreign key column of table 100. First table is updated once on StartUp but second table uses SNMP to gather Task Manager parameters. I have confirmed this is working by displaying the data and by viewing Stream Viewer. I have the Hierarchy/Groups/Timers all set but don't see the data in the TreeView. I have the TreeControl1 parameter set on Task Manager Tree Page.
Is it not possible to do it this way? Why can't table 200 (Process Name IDK) be shown in the tree view?
Is it only possible by updating with a QAction?
Hello,
Your foreignkey column in the Task Manager table is empty, that one should be filled in with the primary key of your first table.
Also on the second table you should have the foreignkey option on the foreignkey column defined like this:
<ColumnOption idx="1" pid="272" type="retrieved" options=";foreignKey=250" />
Also make sure you have specified the relation between the 2 tables.
Ok great that you got it to work. It’s logical that dataminer can’t fill in this column automatically because if you have more than 1 entry in your first table than in the second table with the foreignkey column is it impossible to know which row has to be linked to a row in the first table. That is why we have to fill it in through code to define which row of the second table is linked to the first one.
Also don’t forget to select the answer as the solution on your question.
Thank you for your reply. I managed to get this to work once I filled out the foreign key column. Seems so obvious now that you have to fill out this column with a Qaction. I presumed this was filled out automatically with the primary key from table 1 once tables were linked but this is incorrect.