# How is this possible

**URL:** <https://forum.inductiveautomation.com/t/how-is-this-possible/2851>\
**Category:** Ignition\
**Created:** [April 8, 2011, 6:59pm UTC](https://forum.inductiveautomation.com/t/how-is-this-possible/2851 "2011-04-08T18:59:36Z")\
**Posts on this page:** 16\
**Page:** 2

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [April 28, 2011, 5:56pm UTC](https://forum.inductiveautomation.com/t/how-is-this-possible/2851/21 "2011-04-28T17:56:32Z")

</div>

Just wanted to add that on my little test bed here, the button script would run regardless of whether it was enabled or not (running 7.2.2). 😮

If I also turned off visibility, it would work okay, just not the enable by itself.

Just my two cents, if it helps…

---

<div class="post-metadata">

**Author:** ![Step7](https://avatars.discourse-cdn.com/v4/letter/s/45deac/32.png) [@Step7](https://forum.inductiveautomation.com/u/Step7)\
**Post date:** [April 28, 2011, 6:15pm UTC](https://forum.inductiveautomation.com/t/how-is-this-possible/2851/22 "2011-04-28T18:15:14Z")

</div>

Yes, don’t button events run no matter what? Per this thread… [http://inductiveautomation.com/forum/viewtopic.php?f=63&t=6078&p=16628&hilit=button+disabled#p16628](http://inductiveautomation.com/forum/viewtopic.php?f=63&t=6078&p=16628&hilit=button+disabled#p16628)

Any button I have that uses the enabled property has scripting behind it. I don’t know how to take advantage of the enabled property otherwise.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [April 28, 2011, 6:31pm UTC](https://forum.inductiveautomation.com/t/how-is-this-possible/2851/23 "2011-04-28T18:31:09Z")

</div>

Yeah, I remember that now. Thanks!

So you’d need to put in something like:

`if event.source.enabled
   do this
   do that
   do the other...`  
to be able to use the enabled property. Seems a bit counter-intuitive…

Anyway, I’d say that goes a long way to root cause…

---

<div class="post-metadata">

**Author:** ![jim\_lapratt](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@jim\_lapratt](https://forum.inductiveautomation.com/u/jim_lapratt)\
**Post date:** [April 29, 2011, 11:43am UTC](https://forum.inductiveautomation.com/t/how-is-this-possible/2851/24 "2011-04-29T11:43:37Z")

</div>

For IA tech here is a screen shot today. We got one last night. I have to look at the other info presented here, only had one coffee and am going ![:scratch:](https://us1.discourse-cdn.com/inductiveautomation/original/1X/76d1620bec252bfac07050c889ff5a91dc8a9c25.gif ":scratch:")

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/1X/a41d0e55cdc0ae3f9ba31fdd5d30917b5fedd375.JPG)

---

<div class="post-metadata">

**Author:** ![jim\_lapratt](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@jim\_lapratt](https://forum.inductiveautomation.com/u/jim_lapratt)\
**Post date:** [April 29, 2011, 12:01pm UTC](https://forum.inductiveautomation.com/t/how-is-this-possible/2851/25 "2011-04-29T12:01:59Z")

</div>

Step7 and Jordancclark,

I can’t view that forum… Guess I don’t have enough feathers… Hehe

---

<div class="post-metadata">

**Author:** ![Step7](https://avatars.discourse-cdn.com/v4/letter/s/45deac/32.png) [@Step7](https://forum.inductiveautomation.com/u/Step7)\
**Post date:** [April 29, 2011, 12:35pm UTC](https://forum.inductiveautomation.com/t/how-is-this-possible/2851/26 "2011-04-29T12:35:45Z")

</div>

Sorry, didn’t notice that. The gist of it is in this quote from the thread:

“The event handling code runs whether or not a component is enabled. In your logic for the event handler you should check to see if it’s enabled or disabled and branch from there.”

As Jordan mentioned, the script behind the buton has to explicitly evaluate the enabled condition if you are using that property. Otherwise, I think the only thing it does is make the button look greyed out.

And again, for troubleshooting, be liberal with print statements and turn java logging on. This can’t be stressed enough, in my humble opinion.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [April 29, 2011, 1:59pm UTC](https://forum.inductiveautomation.com/t/how-is-this-possible/2851/27 "2011-04-29T13:59:44Z")

</div>

[quote=“AxisIt”]Step7 and Jordancclark,

I can’t view that forum… Guess I don’t have enough feathers… Hehe[/quote]

Try [this link](http://inductiveautomation.com/forum/viewtopic.php?f=72&t=5796&p=15454&hilit=disabled+button#p15454)…

---

<div class="post-metadata">

**Author:** ![dave.fogle](https://avatars.discourse-cdn.com/v4/letter/d/43a26b/32.png) [@dave.fogle](https://forum.inductiveautomation.com/u/dave.fogle)\
**Post date:** [April 29, 2011, 3:14pm UTC](https://forum.inductiveautomation.com/t/how-is-this-possible/2851/28 "2011-04-29T15:14:43Z")

</div>

Just to avoid any confusion, only the mouse events continue to function when the component is disabled, and the reason they do so is explained in the referenced post from above.

The actionPerformed event (which is where the current script in question is located) will not fire when the component is disabled unless you call a doClick() on the button from scripting.

This is why this problem is confusing. I'll continue to take a closer look and try to figure out what's happening.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [April 29, 2011, 4:48pm UTC](https://forum.inductiveautomation.com/t/how-is-this-possible/2851/29 "2011-04-29T16:48:38Z")

</div>

Thanks, Dave.

Would checking for the enabled state at the beginning of the script be a possible workaround until a root cause is determined? At the very least, it shouldn’t hurt anything.

---

<div class="post-metadata">

**Author:** ![dave.fogle](https://avatars.discourse-cdn.com/v4/letter/d/43a26b/32.png) [@dave.fogle](https://forum.inductiveautomation.com/u/dave.fogle)\
**Post date:** [April 29, 2011, 5:13pm UTC](https://forum.inductiveautomation.com/t/how-is-this-possible/2851/30 "2011-04-29T17:13:46Z")

</div>

It may and it may not and it surely wouldn't hurt anything, but there already is a workaround in place. There are no longer erroneous entries being written. Here we are merely logging any attempts to write that are occurring when we shouldn't be writing and trying to figure out why these are happening.

---

<div class="post-metadata">

**Author:** ![jim\_lapratt](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@jim\_lapratt](https://forum.inductiveautomation.com/u/jim_lapratt)\
**Post date:** [May 3, 2011, 6:07pm UTC](https://forum.inductiveautomation.com/t/how-is-this-possible/2851/31 "2011-05-03T18:07:11Z")

</div>

Ok,

I have removed the binding on the enable of both buttons. I am now setting it with code from the Pin box. We will just have to see if this works better.

Do we have an ETA on when this “Feature” may be fixed?

I could send up the new project file if needed.

---

<div class="post-metadata">

**Author:** ![dave.fogle](https://avatars.discourse-cdn.com/v4/letter/d/43a26b/32.png) [@dave.fogle](https://forum.inductiveautomation.com/u/dave.fogle)\
**Post date:** [May 3, 2011, 11:11pm UTC](https://forum.inductiveautomation.com/t/how-is-this-possible/2851/32 "2011-05-03T23:11:57Z")

</div>

Go ahead and put up the new project just so we have the most recent version.

Unfortunately there is no way that we can have an ETA on a fix until we can figure out what's wrong and some way to consistently replicate it. We'll continue looking into it to see what could possibly be happening.

---

<div class="post-metadata">

**Author:** ![jim\_lapratt](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@jim\_lapratt](https://forum.inductiveautomation.com/u/jim_lapratt)\
**Post date:** [May 4, 2011, 12:55pm UTC](https://forum.inductiveautomation.com/t/how-is-this-possible/2851/33 "2011-05-04T12:55:45Z")

</div>

Well good news. I had no entry’s in the tbl\_admin today.

I set the code to look if they are clocked in and then enable/disable buttons. If they did manage to get punched in twice it would write to the tbl\_admin table and then clock them out of both.

I removed the code from the enable on the buttons to the property change on the Pin box.  
[BDI\_Time\_Clock (2011-05-04).proj](https://us1.discourse-cdn.com/inductiveautomation/original/1X/a983c6e9edd420be82e2ac6a7064149748c7e7e3.proj) (68.1 KB)

---

<div class="post-metadata">

**Author:** ![jim\_lapratt](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@jim\_lapratt](https://forum.inductiveautomation.com/u/jim_lapratt)\
**Post date:** [May 5, 2011, 3:19pm UTC](https://forum.inductiveautomation.com/t/how-is-this-possible/2851/34 "2011-05-05T15:19:24Z")

</div>

All is still good 😃

---

<div class="post-metadata">

**Author:** ![jim\_lapratt](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@jim\_lapratt](https://forum.inductiveautomation.com/u/jim_lapratt)\
**Post date:** [May 6, 2011, 1:01pm UTC](https://forum.inductiveautomation.com/t/how-is-this-possible/2851/35 "2011-05-06T13:01:03Z")

</div>

Another good morning, no errors.

---

<div class="post-metadata">

**Author:** ![jim\_lapratt](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@jim\_lapratt](https://forum.inductiveautomation.com/u/jim_lapratt)\
**Post date:** [May 9, 2011, 11:45am UTC](https://forum.inductiveautomation.com/t/how-is-this-possible/2851/36 "2011-05-09T11:45:41Z")

</div>

Yet another good day.

Well I think we can say the issue is linked to the enabled feature on a component anyways.

[Previous page](https://forum.inductiveautomation.com/t/how-is-this-possible/2851.md?page=1)
