[Bug-15261]Potential Bug - Power Table mouseClicked

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 -

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

That does work as expected.

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?

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.

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.

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

1 Like

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

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.

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.

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.

 object has no attribute 'data'

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

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

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

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:

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.

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?

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.

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

self.visible = False

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.

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.