Dynamic Unselected Backgroud Color for Alarm tab


I want to assign the the Unselected Background Color of my Alarms tab to a custom property I called StatusColor. This custom property type is Color. StatusColor will change from grey to red in the presence of an alarm. I want StatusColor to define the Unselected Background Color for the Alarm tab. Therefore, I created a scrip under property change in order to assign its color to the Unselected Backgrond Color of the Alarm tab.
However, even though I don’t get a warning or error, my script does not seem to do anything:

from java.awt import Color
color = event.source.StatusColor
tabDataset=event.source.parent.getComponent(‘Tab Strip’).tabData
system.dataset.setValue(tabDataset, 5,17, color)

Could someone help me find out what I’m missing?

Thanks in advance.


The system.dataset.setValue() function doesn’t modify the dataset in place – that’s not allowed. Instead, it returns a new dataset with the modification. You must assign that back to the component property.


Thank you for the clarification. You wouldn’t happen to know the proper way to assign the new dataset back?


Like so:

color = event.source.StatusColor
tabStrip = event.source.parent.getComponent('Tab Strip')
tabStrip.tabData = system.dataset.setValue(tabStrip.tabData, 5, 17, color)

That Worked perfectly. Thank you for your help!