Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X
Hello,
i would like to create like a countdown timer in thingworx. that would count from 180 seconds to 0 basically and to have this binded in a mashup.
do you think something like this is possible? if so i would need some help.
i was thinking about creating a function that counts only once and appeal it in a for loop or something like this and save the current seconds in properties.
Solved! Go to Solution.
Refresh Widget has a AutoRefresh bindable property, you just need to bind something to ti (checkbox or alike)
If you just need it on the Mashup Side (not server side) you can use a Refresh Widget and an Expression widget.
Expression widget with a parameter "value" of type NUMBER and the expression = ((value==undefined)||(value==null))?180:(value-1))
you need to bind the expression widget output to itself (value) and set to not automatically trigger.
Then the refresh widget just needs to trigger the expression widget.
To show up on the interface, just add a value display or another widget and bind the expression widget output to it.
thank you! that worked and i also managed to do it in a service. but right now i would like to add a start/stop button so when i press on stop the time would stop from counting down and when i press start the time will continue to go to 0
any idea on this one? i am thinking on having a service that would be triggered by the button
Refresh Widget has a AutoRefresh bindable property, you just need to bind something to ti (checkbox or alike)
that's super cool, thanks a lot!