cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

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

psaxena
1-Newbie

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

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.

1 ACCEPTED SOLUTION

Accepted Solutions

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;

        

  }

}

View solution in original post

8 REPLIES 8
ankigupta
5-Regular Member
(To:psaxena)

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

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,

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.

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;

        

  }

}

Hi Carles,

Thank you so much for your help. I am getting the changing mashup but I need to provide a index to input which mashup to display.

How to change the mashup on autorefresh without providing the index i.e it should just flip bw 2 mashups

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.

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

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

Top Tags