Skip to main content
17-Peridot
May 18, 2020
Solved

How to render mashup in the custom widget ?

  • May 18, 2020
  • 2 replies
  • 2047 views

Hi

 

How can I render mashup in the custom widget ?  something like the Collection widget .  But I couldn't find the client API to render a mashup by it's name .  Anyone knows it ? 

 

Regards,

Sean

Best answer by drichter

Hi,

 

you can look into the source code of the standard widgets when you have access to the twx-server. The formatted widget code can found in tomcatfolder (in my case /usr/share/tomcat8.5/8.5.41/webapps/Thingworx/). You can find the code for build time under Builder/mashup-common-widget-builder.js and the runtime code under Runtime/mashup-common-widget-runtime.js. Inside this you can search for TW.Runtime.Widget.mashupcontainer

 

I hope this helps a bit.

2 replies

Support
June 2, 2020

Hi @seanccc.

 

I'm not clear on what you're trying to do.  Can you please provide details of your use case?

 

Regards.

 

--Sharon

seanccc17-PeridotAuthor
17-Peridot
June 5, 2020

@slangley ,

 

I want to build a custom widget which acts as a container widget , like the contained mashup or collection which allows to put a inner mashup in it.  My widget will has a input paramter named innerMashup and it's type is Mashup,  so during runtime my widget is supposed to call a method like innerMashup.render() I assume ,  right ?   but what's  the exact API of innerMashup.render() ?   And if possible ,  It would be better if I can get the mashup paramters of the innerMashup during design time .

 

Regards,

Sean

drichter1-VisitorAnswer
1-Visitor
June 5, 2020

Hi,

 

you can look into the source code of the standard widgets when you have access to the twx-server. The formatted widget code can found in tomcatfolder (in my case /usr/share/tomcat8.5/8.5.41/webapps/Thingworx/). You can find the code for build time under Builder/mashup-common-widget-builder.js and the runtime code under Runtime/mashup-common-widget-runtime.js. Inside this you can search for TW.Runtime.Widget.mashupcontainer

 

I hope this helps a bit.

seanccc17-PeridotAuthor
17-Peridot
June 6, 2020

@drichter ,

Thank you for the hint .  I'll look up the code .

 

Regards,

Sean 

Support
June 16, 2020

Hi @seanccc.

 

If one of the previous responses answered your question, please mark the appropriate one as the Accepted Solution for the benefit of others with the same question.

 

Thank you for participating in our community.

 

Regards.

 

--Sharon