-
FEATURED COMPONENTS
First time here? Check out the FAQ!
There is a Ifarme in my parent Window,and In the Iframe there are a master Window and a child Window which is created by createComponents method,how can I close the child Window in parent Window's java bind code?
At first I'd suggest to reconsider the usage of an iframe. If not necessary you can avoid this extra complexity. As I understand both your parent and child frame are part of the same application <include src="childPage.zul"/> sounds fair enough.
However if there's an strong need for an <iframe>: In principle you cannot access components directly inside an iframe as they belong to another desktop and you need to communicate via event queues as described here: https://www.zkoss.org/wiki/ZKComponentReference/EssentialComponents/Iframe#RetrievingComponentinsideIframe. If not using ZK EE you'll have to enable server push in the iframe in order to access and update components from another thread.
Since there are many "windows" in your description it's hard to give you the answer you need. In order to help you I'd like to ask you to provide a simplified running example. e.g. on http://zkfiddle.org/ Also please explain what you mean by "bind code"? I assume this will become obvious in your example.
Robert
http://zkfiddle.org/sample/2hm9pho/26-Iframe-detach-exception
There is the example. first click "add" button,create a pop window,then click "exit" button,I want to close pop window in the "exit" button's onclick event.
Hi Hubin,
I updated your example to show how this can be done using a session scoped event queue.
http://zkfiddle.org/sample/2hm9pho/28-Iframe-detach-exception
Still I don't see any reason why you would want to use an iframe for this example. If there's no strong reason for this you can avoid all this overhead by simply using an <include> instead of the <iframe> -> It will both save network traffic and server side memory - and of course avoid the session scoped event queue overhead.
Robert
Asked: 2016-11-24 07:14:12 +0800
Seen: 40 times
Last updated: Nov 28 '16
Any news on zk7 / bootstrap3 ?
Buttons, Tabs not working in zk7 inside Eclipse
Problem with tree and popup (probably a bug)
Portalchildren width is not set properly
How to include the customized Theme? [closed]
zk7 firefox 12 and the look and feel from the combobox
ZK 7: Bootstrap support for combobox/bandbox ?