Closed JelleDekker closed 8 years ago
Jelle, could you send a testproject regarding this issue to community [at] mendix.com? We haven't encountered these issues yet, so we'd like to troubleshoot it.
I'll send the test project, For now you can already find it at https://iframewidgetbug.mxapps.io/index.html?profile=desktop
Second scenario:
Third scenario:
Hi,
Investigated this problem and in my test project, it's originating from two Mendix App Cloud widgets: Mendix App Switcher and Mendix Profile Menu. These two widgets appear to be conflicting with the IFrame widget.
The code below from the Profile Menu & App Switcher widgets raise a multipleDefine(…) dojo error because it appends the same scripts multiple times.
ioScript.get({
url: url + 'mendixtoolbar/js/buttonservices.js?PP_6.20',
error: dojo.hitch(this, function (e) {
console && console.log('Mendix AppSwitcher/ProfileMenu could not load external script: ', e);
})
});
On cancel, another error is triggered, originating from the same buttonservice script that the two widgets are appending:
Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://home.mendix.com') does not match the recipient window's origin ('http://localhost:8080').
This is because the AppSwitcher and ProfileMenu widgets, which generate iframes of their own, are attempting to access an external source running over https yet their origin is not secure (http).
Well, this was all on the assumption that you have these two widgets active in your project too. If so, then I suggest you decide how much you need them in there and consider removing them.
I don't have those widgets in the project where this error originated I'm afraid. Also in the project where I first noticed this, the browser console doesn't show any errors.
Edit: I just updated the example project to resemble the real one more. Removed the two widgets you mentioned and instead added the FormatString widget, which we do use.
I checked the testproject you provided (thanks by the way 😄 ) and found the issue. The reason for this issue is actually that when you update the context object (actually an update is triggered as well when you press Cancel), the url was reloaded. So I changed some of the code, in which that doesn't happen anymore.
Please note (this will be noted in the documentation as well) that some websites do fail to load in an iframe due to restrictions, but that it's pretty hard to determine when this happens. For a website like google.nl, it is blocked in the browser which is impossible circumvent. If for example I load http://nu.nl these problems do not arise.
I'll have a fix for you to test
Please test this version and provide me with some feedback whether or not this issue is fixed for you
The CKEditorForMendix would be an excellent alternative. it has a pretty good iFrame plugin with similar options and a few extra.
@JelteMX The solution seems to work. However in my original application the problem still occurred, I managed to fix it there by removing a "refresh" in the action that processed the users input in the screen.
I tried to reproduce the situation which still gave the problems also in the test project, but there everything goes fine when I do.
Great! I'll create an update for the AppStore
Using the iFrame widget on a page in Mx 6.4.1 I have encountered the following UI issue:
Furthermore:
Update: