Home › Forums › Classic DFFS › iframe disappears
Tagged: iFrame
- This topic has 6 replies, 2 voices, and was last updated 7 years, 2 months ago by Alexander Bautz.
-
AuthorPosts
-
-
September 14, 2017 at 01:34 #18175
In one tab I have a HTML field that has an iframe.
I have a rule that posts to the iframe.This works fine on my display form, but in my edit form the iframe contents disappears if I switch to the tab that contains the iframe.
Using the developer tools, I can see the correct iframe details are loaded by the rule that runs on load. However, once I click on the tab that contains the html field with the iframe, the head and body tags are cleared. No rules are run, so I don’t know what is causing the iframe contents to disappear
Any suggestions on how to troubleshoot or fix this?
- This topic was modified 7 years, 3 months ago by Ivan Wilson.
-
September 18, 2017 at 23:49 #18206
My attempts at debugging this haven’t gotten me a lot further. Somewhere between clicking on the tab and the tab loading, the iFrame is getting lost.
I added a function to call in the tab’s click event. Using the browser debugger I can tell that by the time that function is called, the iframe contents is lost. The call stack doesn’t reveal much and there are no warnings or errors in the console.
The odd thing is that this works fine in the display form, just not in the edit form.
I’ve tried loading different pages in the iframe, but that doesn’t affect it. I’ve attached a before and after image of the DOM to show what’s happening.
Attachments:
-
September 20, 2017 at 19:23 #18229
Sorry for the late reply. I haven’t actually tried using an iframe in a HTML section like this myself – what exactly are you using it for? – maybe there is another way to achieve the same result?
Alexandre
-
September 20, 2017 at 22:26 #18233
I’m displaying a web page from a separate external website. I pass the details in the list item as part of a POST request and this loads a page of related information in the iFrame.
It works great on the display form, but something strange seems to be happening on the edit form.
-
September 27, 2017 at 18:58 #18292
I’m sorry again for the delay. I’m not sure why the content is dropped in the iframe, but maybe your function for loading it fires more than one time? – maybe on click of the tab? Are you able to “reload” the content by calling the function again?
Are you able to see the contents if the tab with the iframe is the first tab so it is initially visible?
Alexander
-
October 1, 2017 at 07:22 #18314
It displays fine on load if it is the first tab, but moving to another tab and back again results in the contents getting cleared.
I can reload by calling my function from the tab’s onclick event, but this results in a delay while the content is reloaded. The displayform tab doesn’t have this problem – I can switch between tabs and the contents remains.
Ivan
-
October 5, 2017 at 19:51 #18367
I’m sorry, but I cannot find anything in my code that could clear the iframe. I have tested putting an iframe loading another page in a tab in NewForm and can navigate to another tab and back without it loosing its content.
Could you try loading it into another “container” – like a div using jQuery.get()
Alexander
-
-
AuthorPosts
- You must be logged in to reply to this topic.