answered
2021-06-10 13:04:51 +0800
MDuchemin 2560 ● 1 ● 6 Hey there.
Here's a sample of manually rewriting events:
https://zkfiddle.org/sample/221p59m/8-Another-new-ZK-fiddle
This is the best you can hope to achieve with iframes.
(won't work in fiddle cause cross-site origin, cause iframes :D, you need to open the page in a new window by clicking on the new window button located near the close button when you run the sample)
what it does is it wires events listeners to the iframe inner document, repeat these events to the main window.
This enable the iframe itself to be a valid target for the drop event (not the components located inside of the iframes, but the frame itself).
Anything more complicated than that would require manual capture and redirection of the events, which is just not a good idea to begin with.
With this said, I want to be very clear about the use case:
Depending on how many of your business screens already implemented with iframes, I'd recommend you still consider just rewriting them by creating components in the same page if you plan on having any interaction between the two contents at all. (using Apply, include, Executions.createComponents)
I understand this might be a big task, but you are using the wrong tool for the job you are trying to accomplish. This will hurt you more and more if you want to implement other interactions between the frames.
Iframes are meant to separate the pages, and allow them to be totally independent from eachother.
If you want interaction, and the pages are located on the same server, it's just the worst possible choice for templating.