Altering the state of a dynamic panel from a page loaded in an inline frame

Edited for clarity.

I need to change the colour of the header dynamic panel, the blue screen should turn red onload when the button is clicked, and for some reason that doesn’t work when the trigger is inside an inline frame. Is there an alternative event I can use that will be triggered when the state of the inline frame changes.

red-blue.rp (61.4 KB)

I’m not clear on what you’re trying to do - do you want that top section to turn blue at the same time the other section turns blue?

1 Like

When you click the button on the all blue screen both sections should turn red. For some reason, no matter where you put the onload, the top section doesn’t change.

Okay hopefully this will work for you. I took the boxes off your inline frame pages and added one to the Home page, and set the command to Open Page 2 in (Inline Frame), this is the only way I know of to control both the panel state and the inline frame statered-blue - edit.rp (60.5 KB)

1 Like

Thank You, I appreciate your help. The problem is the button needs to be inside the inline frame.

This is an app which is designed to display on desktop machines in an inline frame which has the phone skin laid over it, but to also work in the Ax mobile app on a phone. I can’t share the actual model, which is subject to an NDA.

The issue is the app cannot seem to show a white header, so for the desktop page I need a DP at the top of the frame and for a few of the pages the header needs to change colour.

The problem is that you want to trigger action on one page (home) from the page that’s on display within the inline frame. usually you would do that with a global variable, but the only way for the variable to be applied to the Home page would be for some sort of action to reference the home page, and you would probably need the home page to re-load which would look janky. Without giving any secrets away, what is the reason you cannot place a hot spot (or other invisible trigger) over the inline frame on the home page?

1 Like

Basically the triggering actions are in different locations on 30 different pages, so not in a single consistent spot.

Hi!

With a little javascript, you can communicate from the iframe to the page that contains it - and vice-versa - fairly easily. Here’s a post about it.

1 Like

This is great, the only problem is that it seems I can choose between changing the top frame or opening the link, but not both (no matter which order it’s in).

The page is too far down the pecking order to ‘see’ the inline frame I’m linking to, which would enable me to use an alternative option.

Is it an option to convert the panel at the top to a master?
You could set the state onPageLoad?

However if you like to keep your current structure, here is a solution:
Use the onPageLoad of each subpage to set a variable.
On the wrapper page create a loop to check for this variable and set the panel state accordingly.

See the example:
red-blue-trigger.rp (62.9 KB)

You can try experimenting with the delay, depending on your page-complexity and processing power :slight_smile: