Skip to main content
Feb 9, 2021 2:54 PM UTC
Solved

How can we pass parameters to an app which is rendered in IFrame. ?

Hi All,

 

We wanted to pass parameters to our application which is rendering in an iFrame of external application (build on angular). We wanted to utilize window.postMessage() API as part of iFrame contract where we can send information from external application to thingworx app.

 

 

Is it possible ? 

 

Thanks and regards,

Vishal Vaidya

nmillesonAnswer
Feb 9, 2021 4:50 PM UTC

Just a couple ideas:

 

1. You could pass parameters in through the iframe URL.  Just construct the URL in a TWx service with your param values and bind it to the iframe

 

2.  For using the window.postMessage(), have you tried using an expression?  

 

Hope that helps! 

Nick

2 replies

nmillesonAnswer
Feb 9, 2021 4:50 PM UTC

Just a couple ideas:

 

1. You could pass parameters in through the iframe URL.  Just construct the URL in a TWx service with your param values and bind it to the iframe

 

2.  For using the window.postMessage(), have you tried using an expression?  

 

Hope that helps! 

Nick

Feb 18, 2021 8:34 PM UTC

Hi @vvaidya1.

 

If the previous response allowed to find a solution to your issue, please mark it as the Accepted Solution for the benefit of others in the community.

 

Regards.

 

--Sharon