Please bare with me, as i’m pretty new to Ignition.
I have a project that consists of a tabstrip type navigation, with 4 tabs that swap to 4 different windows, and a back and forward button next to the tabs. One of these windows (3) has objects that when clicked on, pass tagpaths and facilityname parameters to a window with more details (e.g motor details window). This populates this window with the correct data.
The back button has “system.nav.goBack()” on mouseClicked.
- Click on a tab-3
- Click on the 1st motor object (swaps to detail window with tagpath and facilityname of 1st motor)
- Click on another tab;
When I hit back 2 times, it goes back to the motor details window with the correct parameters, then back to the starting window. This works as it should.
Where i’m having an issue is that If I:
- Click on a tab-3
- Click on 1st motor object
- Click on tab-3
- Click on 2nd motor object
- Then click on another tab
When I hit back 4 times:
- I go back to the 2nd motor details page with the correct parameters passed
- I go back to tab-3
- The detail page that loads is with the passes parameters of the 2nd motor (should be first)
- Back to Tab-3
I tried this variation clicking through all 9 motors then another tab, then hit back all the way to the start; and the motor detail pages that come up are all from the last motor (9) that was viewed. It’s like the different parameters that were passed aren’t being saved except for the last one, so eveYr detail page uses that parameter.
This doesn’t work for the way we need the navigation to work, so I’m thinking i’m going to have to keep track of the windows that are opened/swaped to (and the passed parameters), then have the back button read through where i have them saved and load it.
I had an idea to use a Client Tag as a dataset with 3 columns (Window, Tagpath, facilityname). Each click of a tab or an object that opens the detail window with it’s parameters, it would add a row to the dataset then populate the entry for each column. I have the Client Tag created and created the 3 columns in it. Each column (Folder) currently has an entry “Row 0”.
I’ve followed an example from another post, to write to a dataset, but it’s for one column. When I try it i get an error that:
Traceback (most recent call last):
File <‘event:mouseClicked’>, line 12, in <‘module’>
IndexError: Number of values (1) doesn’t match number of columns (3) in dataset.
What I have in each tab and Object that opens/swaps a window:
param1 = event.source.parent.SiteName
param2 = event.source.parent.tagPath
recentWindows = system.tag.read("[Client]TestRecentWindows").value
old = system.tag.read("[System]Client/User/CurrentWindow").value
AllValue = [param2, param1, old]
system.tag.write("[Client]TestRecentWindows", system.dataset.addRow(recentWindows, [AllValue]))
Any idea how i have to format the system.tag.write? THanks.