First time here? Check out the FAQ!
Hi all,
i have a zul with an iframe inside. The iframe shows html-code generated with
AMedia amedia = new AMedia("info.html", "text/html", "text/html", i.toString());
info.setContent(amedia);
In the HTML-Code i will integrate a Link with an OnClick-Event. When the Link is clicked an Event must fired to the Parent-zul with an Parameter.
Is this possible and how should the onClick-Event and the Logic in Controller should look like? Or is there another possibility?
Can anyone help me?
Regards Andy
Hello! I hope i correctly interpreted your requirements:
Index.zul:
<zk>
<script type="text/javascript">
function abc(myValue) {
zAu.send(new zk.Event(zk.Widget.$('$win'), 'onTest', myValue, {toServer:true}));
}
</script>
<window id="win" title="Container Window" border="normal" width="300px" onTest='org.zkoss.zul.Messagebox.show("data: " + event.getData())'>
<iframe src="test01/test.zul" />
</window>
</zk>
iframed one:
<window title="IFrame Window" border="normal" width="150px">
<html>
<a onclick="parent.abc(123456);" href="#">fire!</a>
</html>
</window>
Notes:
in the container window i am sending a server event onTest via zAu: but of course it is up to you to decide what to implement inside the abc() function.
Hope it helps! Giovanni
Asked: 2015-12-09 20:21:13 +0800
Seen: 43 times
Last updated: Feb 17 '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 ?