Skip to main content
12-Amethyst
December 14, 2022
Solved

Click event on button in Collection widget

  • December 14, 2022
  • 1 reply
  • 2638 views

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

Best answer by TG_10272716

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

1 reply

19-Tanzanite
December 14, 2022

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?

12-Amethyst
December 14, 2022

Hello @VladimirRosu_116627,

 

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

19-Tanzanite
December 14, 2022

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