Script working on one project but not on the next one

Hi, I have a script on a button that will write to custom properties on my container. I was modifying something else completely and when I went to test the script stopped working.

if event.source.componentEnabled:
	event.source.parent.TabIndexSelected = 4
	event.source.parent.LocalDBRefresh = 1
	event.source.parent.LocalDBRefreshDebounce = 1

On a different project in the same gateway this script works perfectly but when I tried in a different script it didn't worked. I've tried removing the property and create it again but there is something that doesn't want to work. I made sure buttons were enabled. I will probably just get the view from the project that is working into the one that is not.

I just wanted to know if anyone would have some kind of answer.

By not working do you mean that it throws an error or that it simply does nothing?

It simply does nothing, there is no error and the custom properties are not changing. I just confirmed that 2 out of 3 projects that have this script don't work.

This is from the actionPerformed event handler?

Correrct, its on a button. The script is supposed to run when button is released.

Try using .enabled instead of .componentEnabled

1 Like