Skip to main content
1-Visitor
November 23, 2021
Solved

Thingworx Autorefresh Widget

  • November 23, 2021
  • 2 replies
  • 2827 views

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.

 

Best answer by nmutter

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)

 

2 replies

17-Peridot
November 23, 2021
KritikaS1-VisitorAuthor
1-Visitor
November 23, 2021

Hello Satish,

I am using Thingworx 8.5 version.

17-Peridot
November 24, 2021

Okay.

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

nmutter16-PearlAnswer
16-Pearl
November 23, 2021

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)

 

KritikaS1-VisitorAuthor
1-Visitor
November 24, 2021

Thank you, It worked for me.