Tab Strip Component dynamic change color based on tag (vision 8.1.2)

I am trying to dynamically change a tab on a Tab Strip based on tag value. I put the tab strip data into a SQL datatable and using value change script to update that table with new color data when a particular data changes. However for it to work the tab data query has to have update rate defined and when that gets an update it reloads the main view page as if someone reselected it.

Would be nice if you could bind individual components of the tab data table.

https://docs.inductiveautomation.com/display/DOC81/Cell+Update+Bindings

2 Likes

Though, if you are returning a dynamic dataset via a script already, you could just do the color operation in that script?

oh wow I totally missed that. That makes it soo much easier.

ok have that reworked to just use cell update to change color based on tag value But it still forces update and reopens page on change.

Hello,

I came across this thread when looking for a solution to a problem I am having with a tab strip. I have a multi-tiered tab strip set up. The main strip with 4 tabs and the secondary strips having 4-6 tabs each. The secondary tab strip for the "areas" has 6 tabs for different areas. I'm changing the colors of the specific area tabs when an alarm exists for the corresponding area. To do this, I made 6 custom properties on the "areas" secondary tab strip of type color. I then used the cell update tag binding on the "areas" tab data dataset to bind the Background colors for the 6 tabs to the corresponding tab strip custom color properties I made. This was only done on the "areas" tab strip. All others were left without color bindings. This worked fine initially, but I wanted to make the tab color blink and that's when I started having issues. When I set the custom tab strip properties to a blinking color, it caused whatever screen was last selected from the "areas" tab strip to be called every time the blinking color changed. So for example, when running in the client, if I set the blink rate to .5 seconds, it would constantly call the last selected "areas" screen. When I changed to a 20 second blink rate, I was able to navigate through different screens in different tab strips, but once 20 seconds was up and the "areas" tab would blink again, it would change to whatever "areas" screen was last selected, not just the specific "areas" tab that was set to blink. I have no other scripting or anything on the tab strips. Please let me know if this is a known bug or if you're able to offer a solution. It seems like it's just a bug.

Thanks

It seems likely to me that it's not a bug, but something about your implementation. I would start by checking the 'swap mode' of the tab strip - set it to disabled and ensure that you're only reacting to a change event from scripting. You might be getting "spurious" property change events for selectedTab each time the tab strip's dataset changes.

I turned off the tab strip auto navigation and instead put an on click event script in to navigate. Also added client tag that is the navigation page target so I could click something on the page and the navstrip would indicate the correct page and if a navstrip got updated it wouldn't force a page change.

Will get on tomorrow and post some SS of some of my setup.

Create Client tag --- Navigation/TabStrip1_Selected
Set Selected Tab Value = that tag and make it bidirectional
Navigation Mode set to Disabled
Mouse-MouseClicked Event Script

system.nav.swapTo(event.source.selectedTab)

Now you can have tabs that don't lead anywhere if you need. Updates to tabs don't cause screen refresh. And you can have other objects on screen that cause a tab change (just do the same on click scrpit + set the Client tag to the page navigating to.) Other benefit is it is client retentive with the client tags.

There probably are some downsides but that is what worked for me.

1 Like