Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
Hello,
I want to switch the visibility option from a label and a slider in a Mashup
When the button is in the "OFF" state I want the label to be visible and the slider to be invisible.
When the button enters the "ON" state I want the label to be invisible and the slider should be visible.
My current configuration makes it so I can toggle the visibility how I want it for the slider but now the label.
Is it possible to have two options for the state from the togglebutton (OFF and ON)? right know I can only set the "STATE" option but I cannot choose which state and what the output value etc should be...
I am using ThingWorx 9.1.0-b10877 if that matters.
Thank you
Best regards
Nicolas HORST
Solved! Go to Solution.
Hi @Nicolas_HORST.
You could create 2 separate expressions in the Mashup - 1 for each widget to evaluate the current value and then switch it. Here's a link to the Help Center for more information on expressions.
Regards.
--Sharon
Hi @Nicolas_HORST.
You could create 2 separate expressions in the Mashup - 1 for each widget to evaluate the current value and then switch it. Here's a link to the Help Center for more information on expressions.
Regards.
--Sharon
Hi @slangley ,
Thank you for your answer.
I will it with the expressions.
Best regards
Nicolas HORST
Hello @slangley
How can I access the values from the different objects in the mashup?
I've tried making an expression for the slider but I don't know how to "speak" or "listen" to the other values..
I remember in c# you could use (I know its Java)
'ptcslider-16.visibility = true or false'
but I don't know how to do that in java..
The java code I have entered in the expression of the slider:
'
if (Togglebutton_State == FALSE)
{
//this should make the slider invisible
}
else
{
//this should make it visible
}
'
I will also attach a picture of the other settings from the expression.
Best regards
Nicolas HORST
Hi @Nicolas_HORST.
Here's a mashup you can take a look at to help with your scenario. The visibility for the items is toggled by the checkbox widget, but you can substitute with one you deem more appropriate.
In addition, you may want to check out the learning guides on the Developer portal. This one in particular may provide a better understanding of the use of widgets in ThingWorx.
Regards.
--Sharon
Hi @Nicolas_HORST.
If you feel your question has been answered, please mark the appropriate response as the Accepted Solution for the benefit of others with the same question.
Regards.
--Sharon