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

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

Refresh Collection Widget With New Data

zhudson
7-Bedrock

Refresh Collection Widget With New Data

Hello all,

 

I am using the new collection widget in Thingworx 8.4.0 to display 4 mashups of different colors. I have this widget in its own mashup that is contained within a master. On the master, I am able to edit two text boxes, height and width. When I have changed one of those values I press the "update" button and updated the row in the DataTable associated with the collection widget. This then changes the height and width values of each mashup in the collection widget, however it does not update even though I call the service again that initially loads the data into the collection widget.

 

When I refresh the mashup that contains the collection widget, you can see the changes from the new Width or Height values. I attempted to run an expression with location.reload(); on the embedded widget, however that reloads the entire mashup and I only want to update the collection widget. However, I have discovered that if you open a mashup within a master and use the debug view's "Reload" button, it will refresh the contained mashup and not the master. 

 

I have been able to replicate this in a past version of Thingworx (8.0.0) with an expression and the following code: 

if( TW.mashupCache !== undefined )  { 					
	try { 						
		TW.log.info('trying to delete TW.mashupCache[mashupName]'); 						
		TW.mashupCache = {}; 						
		TW.log.info('   deleted TW.mashupCache[mashupName]'); 					
	} catch( err ) {
		
	} 				
}  	            
TW.Runtime.ignoreNextToggleFromBuilder = true;                 
TW.updateStateAndStyleDefinitions();                 
TW.updateLocalizationTokens();                 
TW.Runtime.handleUrlChange(false);

However, when I try to use this same code on the new version of Thingworx, it doesn't work and I don't receive any error messages.  

 

I'm looking to be able to do one of two things:

  1. Update the collection widget when the service is run again.
    OR
  2. Reload the contained mashup in a master, and only the contained mashup. Not the master as well. 

Please let me know if you have any suggestions. Thanks!

1 REPLY 1
posipova
20-Turquoise
(To:zhudson)

The change with the  expression widget behavior is due to the security patches that went in in the newer versions. I would recommend opening a support ticket to troubleshoot this further.

Top Tags