How to refresh the binding on Iframe?

How can we refresh the data/web source binding on a IFrame?

If you are running refresh script from the Iframe itself

self.refreshBinding('props.src')

Otherwise the self should be replaced by the exact path of the Iframe

This did not work. when i refresh the page, Iframe is getting the updated data.

How can I update the data on Iframe without refreshing the perspective session? DataSource to iframe is from database query..

Include a "throw-away" query parameter in the URL in the IFrame, and change that parameter each time you wish to refresh. You are dealing with browser caching behavior, not anything Ignition is responsible for.

3 Likes

that works, like src="/system/webdev/MESCADA/data/reports/testC6.html?A=%s" % str(system.date.now())

what is A in this example? Is that a parameter how does it know when to refresh?

@ahernandez, this question is about Vision's IFrame. Are you using that or Perspective's Inline Frame?

What is A in this example?

It's a URL GET parameter=value pair. The web server that is being called isn't expecting a parameter called 'A' so it ignores it but does serve up the page again.

The browser does care about it. As far as it's concerned you've requested the page again but with a different parameter so it makes a repeat request.

Is that a parameter how does it know when to refresh?

That's part of a script triggered by something else and since it references system.date.now() it will change the 'A' parameter value.

1 Like