# Dynamic Unselected Backgroud Color for Alarm tab

**URL:** <https://forum.inductiveautomation.com/t/dynamic-unselected-backgroud-color-for-alarm-tab/16930>\
**Category:** Ignition\
**Tags:** ignition79, database, scripting\
**Created:** [February 8, 2018, 10:35pm UTC](https://forum.inductiveautomation.com/t/dynamic-unselected-backgroud-color-for-alarm-tab/16930 "2018-02-08T22:35:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![JM\_PEREZ](https://avatars.discourse-cdn.com/v4/letter/j/a9adbd/32.png) [@JM\_PEREZ](https://forum.inductiveautomation.com/u/JM_PEREZ)\
**Post date:** [February 8, 2018, 10:35pm UTC](https://forum.inductiveautomation.com/t/dynamic-unselected-backgroud-color-for-alarm-tab/16930/1 "2018-02-08T22:35:20Z")

</div>

Hello,

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.

Jose

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 9, 2018, 1:10am UTC](https://forum.inductiveautomation.com/t/dynamic-unselected-backgroud-color-for-alarm-tab/16930/2 "2018-02-09T01:10:08Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![JM\_PEREZ](https://avatars.discourse-cdn.com/v4/letter/j/a9adbd/32.png) [@JM\_PEREZ](https://forum.inductiveautomation.com/u/JM_PEREZ)\
**Post date:** [February 23, 2018, 1:38am UTC](https://forum.inductiveautomation.com/t/dynamic-unselected-backgroud-color-for-alarm-tab/16930/3 "2018-02-23T01:38:56Z")

</div>

pturmel,

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

Jose

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 23, 2018, 2:36am UTC](https://forum.inductiveautomation.com/t/dynamic-unselected-backgroud-color-for-alarm-tab/16930/4 "2018-02-23T02:36:05Z")

</div>

Like so:

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

```

---

<div class="post-metadata">

**Author:** ![JM\_PEREZ](https://avatars.discourse-cdn.com/v4/letter/j/a9adbd/32.png) [@JM\_PEREZ](https://forum.inductiveautomation.com/u/JM_PEREZ)\
**Post date:** [February 23, 2018, 5:40pm UTC](https://forum.inductiveautomation.com/t/dynamic-unselected-backgroud-color-for-alarm-tab/16930/5 "2018-02-23T17:40:16Z")

</div>

That Worked perfectly. Thank you for your help!
