# \[Bug-15261\]Potential Bug - Power Table mouseClicked

**URL:** <https://forum.inductiveautomation.com/t/bug-15261-potential-bug-power-table-mouseclicked/29288>\
**Category:** Ignition\
**Tags:** ignition80, scripting\
**Created:** [October 22, 2019, 3:47pm UTC](https://forum.inductiveautomation.com/t/bug-15261-potential-bug-power-table-mouseclicked/29288 "2019-10-22T15:47:42Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![ray.crowder](https://avatars.discourse-cdn.com/v4/letter/r/e480ec/32.png) [@ray.crowder](https://forum.inductiveautomation.com/u/ray.crowder)\
**Post date:** [October 22, 2019, 3:47pm UTC](https://forum.inductiveautomation.com/t/bug-15261-potential-bug-power-table-mouseclicked/29288/1 "2019-10-22T15:47:42Z")

</div>

Version - 8.0.5 ( b2019101516)

Mouse Event Handlers for the Power Table only seem fire when clicking on non-populated parts of the component (ie - white space). If a populated cell is clicked, no event is fired. I have tried each of the mouse events handlers.

My simple test setup -

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/a/ad23016d7dfe446ef7226ae244a10729d526edf2.png)

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [October 22, 2019, 3:49pm UTC](https://forum.inductiveautomation.com/t/bug-15261-potential-bug-power-table-mouseclicked/29288/2 "2019-10-22T15:49:51Z")

</div>

Have you tried the `onMouseClick` extension function listed below `mouseClicked` in your screenshot?

---

<div class="post-metadata">

**Author:** ![ray.crowder](https://avatars.discourse-cdn.com/v4/letter/r/e480ec/32.png) [@ray.crowder](https://forum.inductiveautomation.com/u/ray.crowder)\
**Post date:** [October 22, 2019, 3:50pm UTC](https://forum.inductiveautomation.com/t/bug-15261-potential-bug-power-table-mouseclicked/29288/3 "2019-10-22T15:50:53Z")

</div>

That does work as expected.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [October 22, 2019, 4:01pm UTC](https://forum.inductiveautomation.com/t/bug-15261-potential-bug-power-table-mouseclicked/29288/4 "2019-10-22T16:01:13Z")

</div>

It looks to me like `mouseClicked` executes anywhere inside a Power Table which is NOT a data cell, and `onMouseClick` works anywhere which IS a data cell, although I am using a nightly build. Is this the behavior you’re experiencing?

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [October 22, 2019, 4:03pm UTC](https://forum.inductiveautomation.com/t/bug-15261-potential-bug-power-table-mouseclicked/29288/5 "2019-10-22T16:03:40Z")

</div>

The `onMouseClick` Extension Function does specify that it is called when the click occurs on a table cell, which leads me to believe that one should not expect the more generic `mouseClicked` function to also be executed when a table cell is clicked.

---

<div class="post-metadata">

**Author:** ![ray.crowder](https://avatars.discourse-cdn.com/v4/letter/r/e480ec/32.png) [@ray.crowder](https://forum.inductiveautomation.com/u/ray.crowder)\
**Post date:** [October 22, 2019, 4:22pm UTC](https://forum.inductiveautomation.com/t/bug-15261-potential-bug-power-table-mouseclicked/29288/6 "2019-10-22T16:22:37Z")

</div>

> It looks to me like `mouseClicked` executes anywhere inside a Power Table which is NOT a data cell, and `onMouseClick` works anywhere which IS a data cell, although I am using a nightly build. Is this the behavior you’re experiencing?

Yes, that is the behavior I am seeing.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [October 22, 2019, 5:06pm UTC](https://forum.inductiveautomation.com/t/bug-15261-potential-bug-power-table-mouseclicked/29288/7 "2019-10-22T17:06:49Z")

</div>

After asking around, it seems that this is indeed unexpected behavior, so I opened a new ticket to address it.

---

<div class="post-metadata">

**Author:** ![lauren.chandler](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lauren.chandler/32/9664_2.png) [@lauren.chandler](https://forum.inductiveautomation.com/u/lauren.chandler)\
**Post date:** [April 17, 2020, 12:23pm UTC](https://forum.inductiveautomation.com/t/bug-15261-potential-bug-power-table-mouseclicked/29288/8 "2020-04-17T12:23:27Z")

</div>

Has this been fixed? I am getting the same issue in 8.0.10?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [April 17, 2020, 3:30pm UTC](https://forum.inductiveautomation.com/t/bug-15261-potential-bug-power-table-mouseclicked/29288/9 "2020-04-17T15:30:53Z")

</div>

No, this hasn’t been fixed - it’s at a low priority because there’s an easy workaround. It’s a bit confusing, to be sure, but using the extension function should work fine.

---

<div class="post-metadata">

**Author:** ![lauren.chandler](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lauren.chandler/32/9664_2.png) [@lauren.chandler](https://forum.inductiveautomation.com/u/lauren.chandler)\
**Post date:** [April 21, 2020, 6:01pm UTC](https://forum.inductiveautomation.com/t/bug-15261-potential-bug-power-table-mouseclicked/29288/10 "2020-04-21T18:01:17Z")

</div>

Except it seems there is a bug in the extension functions where the “self” property isn’t defined in most, but not all power tables created. I already have a ticket in for this issue, and I was using the non-extension event handler as the work around already.

---

<div class="post-metadata">

**Author:** ![elliot.lohr](https://avatars.discourse-cdn.com/v4/letter/e/3bc359/32.png) [@elliot.lohr](https://forum.inductiveautomation.com/u/elliot.lohr)\
**Post date:** [December 21, 2020, 9:31pm UTC](https://forum.inductiveautomation.com/t/bug-15261-potential-bug-power-table-mouseclicked/29288/11 "2020-12-21T21:31:05Z")

</div>

Did Lauren’s question ever get answered?

I’m trying to play around with the data in the row I clicked, but using the extension functions I’m unable to access properties of the table

i.e.

```auto
 object has no attribute 'data'

```

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [December 22, 2020, 7:28am UTC](https://forum.inductiveautomation.com/t/bug-15261-potential-bug-power-table-mouseclicked/29288/12 "2020-12-22T07:28:23Z")

</div>

What extension function are you using? I just tested onMouseClick and encountered no issue.

```auto
print(str(self.data.getValueAt(rowIndex, colIndex)))

```

resulted in my Designer console displaying the data of the cell I clicked.

---

<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:** [May 20, 2021, 10:26pm UTC](https://forum.inductiveautomation.com/t/bug-15261-potential-bug-power-table-mouseclicked/29288/13 "2021-05-20T22:26:44Z")

</div>

This also seems to be a bug for the MouseMoved event… of which there is no workaround, as there is no extension function for MouseMoved.  
If i put the following code in the event handler for mouseMoved:

```auto
print "Mouse moved (%s,%s)" % (event.x,event.y)

```

I get a print out to the console whenever i move the mouse over **non populated rows**. However it does not fire when the rows are populated.

I am trying to find a way to indicate that the user has finished selecting rows. What i wanted to do was use a timer in conjunction with mouseMoved event to indicate that the user has stopped moving the mouse for X seconds.

Any workaround would be appreciated.

---

<div class="post-metadata">

**Author:** ![jespinmartin1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jespinmartin1/32/57175_2.png) [@jespinmartin1](https://forum.inductiveautomation.com/u/jespinmartin1)\
**Post date:** [May 21, 2021, 2:12am UTC](https://forum.inductiveautomation.com/t/bug-15261-potential-bug-power-table-mouseclicked/29288/14 "2021-05-21T02:12:35Z")

</div>

Is not a bug, is something with java swing, each cell has its own event listener and mouseMoved() will only apply to the view at view port table, which is the place you call “non populated rows”.  
What is your request again?  
A notification when mouse is not moving over table component?

---

<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:** [May 21, 2021, 2:27am UTC](https://forum.inductiveautomation.com/t/bug-15261-potential-bug-power-table-mouseclicked/29288/15 "2021-05-21T02:27:26Z")

</div>

Interesting, i am not quite at the advanced level with Java yet to understand some of the underlying methods.

I’d like a way to know when the user has stopped moving the mouse over the table.  
I’ve created my own version of a dropdown list component which allows the user to select multiple rows (of a Power Table).  
They complained that the dropdown list didn’t vanish after they selected something, so i’ve tried to use a timer to hide the table after they have selected a row for X seconds.  
But i want to reset that timer if the mouse is still moving around in the area.

---

<div class="post-metadata">

**Author:** ![jespinmartin1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jespinmartin1/32/57175_2.png) [@jespinmartin1](https://forum.inductiveautomation.com/u/jespinmartin1)\
**Post date:** [May 21, 2021, 4:55am UTC](https://forum.inductiveautomation.com/t/bug-15261-potential-bug-power-table-mouseclicked/29288/16 "2021-05-21T04:55:00Z")

</div>

This sound way to complicate.  
Just add on Extension Function onMouseRelease():

```auto
self.visible = False

```

---

<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:** [May 21, 2021, 5:10am UTC](https://forum.inductiveautomation.com/t/bug-15261-potential-bug-power-table-mouseclicked/29288/17 "2021-05-21T05:10:16Z")

</div>

That won’t allow for users to select multiple rows. As soon as they release mouse from selecting the first row, it will go invisible.  
EDIT: I tried it anyway, but that event is only fired if your mouse is not on a populated row.

---

<div class="post-metadata">

**Author:** ![jespinmartin1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jespinmartin1/32/57175_2.png) [@jespinmartin1](https://forum.inductiveautomation.com/u/jespinmartin1)\
**Post date:** [May 21, 2021, 7:13pm UTC](https://forum.inductiveautomation.com/t/bug-15261-potential-bug-power-table-mouseclicked/29288/18 "2021-05-21T19:13:03Z")

</div>

Well, you can do something like this:

1. Set your drop down to table move and set max min to negatives.
2. In drop down, you should place scripts at focusGained(), focusLost (): using attributes like .showPopup() .isPopupVisible() and playing with the visible property of power table. Something like when focus is gained show pop up and make table visible when focus lost if popup is not visible so table should not be visible either.  
3.Now need to make the table visible or not with mouse events. At mouse release in drop down component, try something like if isPopupVisible() is true then make table visible property else or elif false do the opposite.
