What ZK does is that it loads your loginModal
page in one desktop and your iframeLogin
page in another desktop. The notion of a desktop is further clarified here.
Thus, loginModal
is not the parent browser window of iframeLogin
. This is why getParent
returns null
when you invoke it on your iframe.
As stated in ZK Component Reference, one may not access components attached to other desktops. In other words, the information exchange between loginModal
and iframeLogin
is disabled.
It seems that you have one of two options:
- Do without an iframe and use
include
instead. - Use an iframe but define an Event Queue under the group scope. Make this event queue visible to both
loginModal
andiframeLogin
, and use it to exchange information between the two desktops you have.
EDIT 1
Please ensure that:
- the client-side namespace is incorporated by inserting
xmlns:w="http://www.zkoss.org/2005/zk/client"
into yourwindow
tag. - your JS code is evaluated after creating all the widgets by inserting
defer="true"
into yourscript
tag.
In your second JS snippet, this
references the script
widget itself. Your window
and script
co-exist in the same ID space. In other words, your window
and script
are fellows.
Therefore, to reference your window
from your script
, please use any of the following:
this.$f('loginModal').setHeight("500px");
this.$f().loginModal.setHeight("500px");
zk.Widget.$(jq('$loginModal')[0]).setHeight("500px");
Instead of:
loginModal.height = 500;
EDIT 2
To further exemplify, the following JS script
would double the initial height of loginModal
:
<window id="loginModal" title="Login" border="normal" width="500px" height="350px" xmlns:w="http://www.zkoss.org/2005/zk/client">
<script defer="true">
this.$f('loginModal').setHeight("700px");
</script>
</window>