Skip to main content
Nov 23, 2021 5:43 AM UTC
Solved

Thingworx Autorefresh Widget

Hello Everyone

I have one TestMashup, in that I am using contained mashup in Tabs widget to call two different mashups, "CheckTest1" and "CheckTest2". In CheckTest1, I am using the Autorefresh widget to call a service after ever 5 seconds and in CheckTest2, I am using the Autorefresh widget to call a service after ever 10 seconds. But, when I view my mashup at runtime having default tab selected as "CheckTest1", The service for "CheckTest2" is also getting executed.
As per my understanding Autorefresh widget should be called only when we click on the tab for CheckTest2.

Can anyone help with this? Please View the attached screen shot.

 

nmutterAnswer
Nov 23, 2021 10:52 PM UTC

Both contained mashups are loaded in the browser and therefore both autorefresh widgets are executed at the same time. It is not so nice but I have no good solution for it.

 

One workaround is to add a parameter to your contained mashups "isSelected" which you bind via an expression on the mashup with the tabs - which evaluates if tab1 isSelected (by checking the value of selectedTab). In the contained mashups you will bind the isSelected to the autoRefresh-widget.

For each tab basically such binding:

nmutter_0-1637707747499.png

And in the contained mashups you do:

nmutter_1-1637707842656.png

Maybe this helps.

 

I also see property "AutoRefreshTabSequence" on the refresh widget but I do not think that it is related to Tabs (at least I could not figure it out)

 

6 replies

Nov 23, 2021 11:55 AM UTC
KritikaSAuthor
Nov 23, 2021 1:54 PM UTC

Hello Satish,

I am using Thingworx 8.5 version.

Nov 24, 2021 4:08 AM UTC

Okay.

What exactly you want? You don't want to activate auto refresh if tab2 is not selected?

nmutterAnswer
Nov 23, 2021 10:52 PM UTC

Both contained mashups are loaded in the browser and therefore both autorefresh widgets are executed at the same time. It is not so nice but I have no good solution for it.

 

One workaround is to add a parameter to your contained mashups "isSelected" which you bind via an expression on the mashup with the tabs - which evaluates if tab1 isSelected (by checking the value of selectedTab). In the contained mashups you will bind the isSelected to the autoRefresh-widget.

For each tab basically such binding:

nmutter_0-1637707747499.png

And in the contained mashups you do:

nmutter_1-1637707842656.png

Maybe this helps.

 

I also see property "AutoRefreshTabSequence" on the refresh widget but I do not think that it is related to Tabs (at least I could not figure it out)

 

KritikaSAuthor
Nov 24, 2021 7:27 AM UTC

Thank you, It worked for me.