Skip to main content
7-Bedrock
February 9, 2021
Solved

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

  • February 9, 2021
  • 2 replies
  • 1430 views

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

Best answer by nmilleson

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

nmilleson17-PeridotAnswer
17-Peridot
February 9, 2021

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

Support
February 18, 2021

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