cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

Click event on button in Collection widget

FS_10272716
10-Marble

Click event on button in Collection widget

Hello,

 

I created a Collection widget that has cells in it. Each cell contains certain attributes and a button.

I attached an image, so you can see what I mean. The cell is the grey area. The button that triggers a service is the star. (it is a button without a text an an icon)

FS_10272716_2-1671007869199.png

 

  1. When you click somewhere in a cell, an event is triggered and a new page with additional information about the specific element of the cells is opened.
  2. Now I added a button the the cell (the star) that triggers an event when you click it - this should just call a service

The problem now is, that the click event on the button is triggered and then a click event on the cell is triggered even tough i just clicked the button.

 

I have tried several things. I tried using a default button with just text without modifications - I tried increased the z-index of the button, I added more text to it -> all this did not work.

 

Is there a way to prevent the cell from triggering a click event when i click the button?

 

BR

1 ACCEPTED SOLUTION

Accepted Solutions

I just tried it. When I click the button I get both messages. When I click the cell I get just one. Increasing the z-index did not help either. It seems to be a bug in TW Navigate 9.1.0. I tried it in Firefox and Chrome.

Thank you for your help, now I at least know that the problem is not my implementation.

I will just disable the cells click event and add an invisible button in each cell to act as a custom click event trigger.

 

BR

View solution in original post

5 REPLIES 5

What specific ThingWorx version are you using?

I've tried this setup in my 9.3.5 in Firefox and it worked fine. Clicking the button triggered the proper status message, and clicking outside of the button triggered the host status message. I've used Status Messages instead of Navigate functions.

Do you want me to attach my entities?

Hello @VladimirRosu,

 

I am using TW Navigate 9.1.0. If you do not mind I would like to try yours, if my TW is able to import it.

 

BR

 Here it is. In the CellMashup it's the button with icon.

I just tried it. When I click the button I get both messages. When I click the cell I get just one. Increasing the z-index did not help either. It seems to be a bug in TW Navigate 9.1.0. I tried it in Firefox and Chrome.

Thank you for your help, now I at least know that the problem is not my implementation.

I will just disable the cells click event and add an invisible button in each cell to act as a custom click event trigger.

 

BR

I checked quickly and this was a regression & was fixed in 9.1.2.

Release notes here,  you can look at the "Fixed an issue with the Collection widget that was causing a conflict between the CellWasClicked and Clicked events."

.

Top Tags