Hey, a problem I have come across is that I am not able to load something in an iframe.
Here is what I do:
On my main page I press two buttons and the iframe appears, loads content from a different page (page 2) with a few buttons inside. I would like to press one of these buttons and reload different content in the iframe from another page (page 3).
I tried to solve the problem of the button not knowing that it is in an iframe by onclick setting a variable to 1 and reloading the page. I told the page then, if the variable was 1, give me page 3 in the iframe.
This only works if the Open Link is set to New Window. It’s not working with Current Tab.
Is there any other way to load a differnet iframe from within an iframe?
I’m not sure I understand your setup… Why do you need to press two buttons? Do you only have one inline frame on main page? Does pressing a button on page 2 load page 3 in that same inline frame? Perhaps you could upload your .rp file?
In general, if you want to load content to an inline frame widget from outside that inline frame, use the Open Link in Frame action. If you want to load a different page from within the inline frame, just use the default Open Link in Current Window action.
OK, here is a quick demonstration:
Inline Frame Tests.rp (120.5 KB)
The “Load Page 1 to Frame” button demonstrates loading content into an inline frame. Simple.
On Page 1, the “Load Page 2” button demonstrates loading another page within that inline frame. Simple.
On each numbered page there is also a button to set the OnLoadVariable to that page’s number. On the Home page, pressing the “Get OnLoadVariable” button sets the text of the “testVar” widget next to it to the value of OnLoadVariable. This just demonstrates passing a global variable from a page in an inline frame to another (its parent) page.
If “testVar” is set to a value of “3” then it loads page 3 into the inline frame. This demonstrates another way to load a page into an inline frame in a remote fashion.
I also included a button for “Automatically Get OnLoadVarialble”. When this button is selected the “functionAutoGet” dynamic panel is set to automatically change states repeatedly so that it continuously checks the value of OnLoadVariable and sets that value on the “testVar” widget. In this way, when any of the “Set OnLoadVariable” buttons are pressed, the result automatically shows up on “testVar” within 500 ms. Of course, if this value is “3” then the Page 3 will automatically be loaded.
Hope this helps.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.