Skip to main content
1-Visitor
June 20, 2017
Solved

How to use the "click" event of a 3D label in ThingWorx Studio?

  • June 20, 2017
  • 2 replies
  • 4969 views

Hi,

I want to show some labels which on clicking will show other labels. That means if there are two labels Label1 and Label2 then on clicking on Label1, Label2 will be visible. I have written a service which will update a Thing Property value to True/False based on the click. I have bind the Label1 click property to this service. Also the Thing property value is bind to the Label2.

But this is not working. Can anyone please tell me some way to achieve the task?

Thank you...

Regards,

Dipika

Best answer by ankigupta

Hi Dipika Sengupta​,

Is there any specific reason to write the service in ThingWorx.

You can directly add following code in ThingWorx Studio to make the 3D label widget visible:

$scope.view.wdg['3DLabel-2']['visible'] = true;

And call the function on click event of 3D label1.

I hope it helps.

2 replies

ankigupta5-Regular MemberAnswer
5-Regular Member
June 20, 2017

Hi Dipika Sengupta​,

Is there any specific reason to write the service in ThingWorx.

You can directly add following code in ThingWorx Studio to make the 3D label widget visible:

$scope.view.wdg['3DLabel-2']['visible'] = true;

And call the function on click event of 3D label1.

I hope it helps.

1-Visitor
June 21, 2017

Hi Ankit Gupta

Thank you for the solution. It worked!!

I have another doubt. I have tried the same thing with model-items. I tried the click event of the model-item to show some 3d Label. It is working in the preview but not working while experiencing it from mobile device. Is there any work around?

Thank you...

Regards,

Dipika

1-Visitor
January 5, 2018

Hi,

I am having the same issue. in preview the event triggers when clicked but in a touchscreen device it does not. Is there any solution that would also work in ThingWorx View?

1-Visitor
January 5, 2018

I managed to get this working. Just tested it once more and it worked.