# Dropdown propertyChange not fired on Enabled property

**URL:** <https://forum.inductiveautomation.com/t/dropdown-propertychange-not-fired-on-enabled-property/14651>\
**Category:** Ignition\
**Created:** [June 28, 2017, 9:59pm UTC](https://forum.inductiveautomation.com/t/dropdown-propertychange-not-fired-on-enabled-property/14651 "2017-06-28T21:59:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![richardNZ15](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/richardnz15/32/33373_2.png) [@richardNZ15](https://forum.inductiveautomation.com/u/richardNZ15)\
**Post date:** [June 28, 2017, 9:59pm UTC](https://forum.inductiveautomation.com/t/dropdown-propertychange-not-fired-on-enabled-property/14651/1 "2017-06-28T21:59:54Z")

</div>

As the title says, I don’t seem to get an event fired when the Enabled property on my Dropdown component is changed. The Enabled property is bound to something.

I am trying to set the selectedStringValue to -1 so that it will display the “No Selection Label” when the component is disabled.

This is my code on the propertyChange event script:

```auto
if event.propertyName == "componentEnabled":
	if event.newValue == 0:
		event.source.selectedStringValue = "-1"
		event.source.parent.getComponent('Label 7').text = "Disabled"
	else:
		event.source.parent.getComponent('Label 7').text = "Enabled"
	# end if
	
# end if

```

The label text change is just for debugging, the label text isnt changing regardless of what the newValue is so it seems to me the event just isnt firing. Why might this be?

Are propertyChange event scripts fired before the bindings are or something?  
Or can the scripts not work when a component is enabled… In which case i’d still expect it to change my label when the component is Enabled again.

---

<div class="post-metadata">

**Author:** ![Paul.Scott](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul.scott/32/4578_2.png) [@Paul.Scott](https://forum.inductiveautomation.com/u/Paul.Scott)\
**Post date:** [June 28, 2017, 10:12pm UTC](https://forum.inductiveautomation.com/t/dropdown-propertychange-not-fired-on-enabled-property/14651/2 "2017-06-28T22:12:15Z")

</div>

It looks like the property description needs to be updated. The property name should be `enabled`, but the scripting name on the property says `componentEnabled`.

If you’re curious how I figured it out, I simply added `print event.propertyName` above your example.

I’ll make a ticket to update the description, but in the meantime you should be able to get your code to work by changing the property name your line 1 is filtering on.

```python
if event.propertyName == "enabled":

```

---

<div class="post-metadata">

**Author:** ![richardNZ15](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/richardnz15/32/33373_2.png) [@richardNZ15](https://forum.inductiveautomation.com/u/richardNZ15)\
**Post date:** [June 28, 2017, 10:35pm UTC](https://forum.inductiveautomation.com/t/dropdown-propertychange-not-fired-on-enabled-property/14651/3 "2017-06-28T22:35:56Z")

</div>

Ah yep thats working. Ironically i did start to write “enabled” but then checked the tooltip and changed it before testing the code…

Thanks!

---

<div class="post-metadata">

**Author:** ![Paul.Scott](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul.scott/32/4578_2.png) [@Paul.Scott](https://forum.inductiveautomation.com/u/Paul.Scott)\
**Post date:** [July 6, 2017, 3:57pm UTC](https://forum.inductiveautomation.com/t/dropdown-propertychange-not-fired-on-enabled-property/14651/4 "2017-07-06T15:57:49Z")

</div>

In the interest of posterity, `componentEnabled` is the correct scripting name of the ‘Enabled’ property that is found in the Property Editor. The problem here is that the `componentEnabled` property just doesn’t fire changes that propertyChange can catch (which is true of many properties).

The `enabled` property mentioned above is a separate property that does fire a change, which is why the code above started working. The `enabled` property is what actually disables the component, but considers both the value of `componentEnabled` as well as any component security settings that are attempting to disable the component.

A brief overview of the two properties:  
`componentEnabled` = the value of “Enabled” property in the Property Editor.  
`enabled` = componentEnabled’s value AND component security settings
