Skip to main content
1-Visitor
September 15, 2016
Solved

How to implement a flipping panel in thingworx i.e in a mashup for 2 seconds one panel should be visible and for next 2 seconds it should toggle to another mashup

  • September 15, 2016
  • 2 replies
  • 3226 views

in my mashup there are several panels. I want that for 2 seconds one panel should b visible and after that it should flip to another panel in that place only.

Best answer by CarlesColl

On a Helper Thing, you can set a service like this:

Service GetNextMashup(index as INTEGER) returns MASHUPNAME {

var result = "firstMashupName";

switch (index) {

    case 1:

          result = "secondMashupName";

          break;

   case 2:

        result = "thirdMashupName";

        break;

        

  }

}

2 replies

5-Regular Member
September 15, 2016

Hi Priyanshi,

Interesting requirement. I seems that we don't have something of that kind inbuilt in ThingWorx. Maybe you will have to write your own extension for that.

But I thought a bit about this and a possible solution could be to use Tab Widget for this. You can change the SelectedTabValue regularly (at a defined interval) using some custom service and Auto-refresh widget.In the latest version you wouldn't even need a Auto-Refresh widget as you can use Automatically update values in Mashup using GetProperties service.

So it will switch to different tabs regularly.

Thanks,

Ankit Gupta

1-Visitor
September 15, 2016

Hi,

You don't need a tab widget, with just a contained mashup, and loading another mashup on it with the Auto-Refresh widget will do the trick. You can have a service, which returns the desired Step 2 mashup, something like GetNextMashup(index), where index it's 1, 2, 3,...

Best Regards,

psaxena1-VisitorAuthor
1-Visitor
September 16, 2016

Hi Carles,

Yes it seems Im getting your idea somewhat, but please can you elaborate a little more as to what my service would look like i.e what will be the service to load the mashup in the contained mashup area.

1-Visitor
September 16, 2016

On the mashup side, you can have an expression widget which computes 1,2,1,2,1,2, you can set the output of the expression widget as the input for itself, and the expression should be something like ( expression widget should have a parameter called currentValue ) :

(currentValue==1?2:1)

Then you can bind the result of the expression widget to the previous service.

Once done this, you just need to set the Autorefresh widget to trigger the expression widget.

psaxena1-VisitorAuthor
1-Visitor
September 16, 2016

Hi Carles,

I have implemented this but I am not able to get the starting value of variable currentValue....as the input is binded to output

1-Visitor
September 16, 2016

Trigger it at form load, it will generate 1 as currentValue!=1