Autorefresh iFrame in a CorePro user panel

Updated by Brett Patram

Scope

Pathfinder CorePro user panels have the capability to display iFrames, which can show content from external websites.

If the content on the external website does not update dynamically, you might want to automatically refresh the iFrame.

This help document will guide you through the steps to add logic that automatically reloads the iFrame content after a specified period of time.

Step by Step

It is assumed that you have already created a user panel, with an iFrame placed in it
Part1 - Enable Binding for iFrame src property
  1. Select the iFrame component on the user panel. On the property table click the Blue binding icon next to the src property
  1. Save the changes to the panel

Part 2 - Create the page reload timer
  1. Go to the Timers page
  2. On the Timers tab, select the + icon at the lower right side of the list to create a new timer
  3. Set the Timer Type as Interval
  4. Set the Interval value to equal how often you would want the iFrame to reload (in ms)
  5. Set Autoreset to True
  6. Set Enabled to True
  7. Click Appy

Part 3- Create logic flow for page reload
  1. Go to the Logic Flows page

For best practice, make a new Logic Flow folder to store this logic inside

  1. Add a Logic Flow
  1. Set the Start Point of the logic flow to the Interval Timer's "Elapsed" property

  1. Set the End Point of the logic flow to the User Panel's iFrame src "Value" property

  1. Set the List Translator so that the first Entry has the left side condition set to False and the Value is set to the URL of the site you want to load
  2. Add another entry so that the it has the left side condition set to False and the Value is left blank

The final result will be a logic flow that looks similar to this:

Test it out

Load the user panel and observe that the iFrame content will now reload every 10 seconds (or however long your interval timer was set to)

How it works:

The interval timer's "Elapsed" property will normally be False. When the timer duration elapses, the Elapsed property will briefly become "True" and then go back to "False" when the timer automatically resets

We use the False state of the timer to set the iFrame SRC to the desired page.

We use the True state of the timer to momentary clear the iFrame SRC. So that the iFrame SRC will load fresh, when the Elapsed property once again goes back to the resting False state

Its not perfect, and some pages might not load as expected. Some sites will rate limit you if you are making constant requests too frequently, so use this with care. Ideally this is pointed to something like a local web server that might have static content that updates every so often.

Let us know how we can help

If you have further questions on this topic or have ideas about improving this document, please contact us.


How did we do?