-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I would like to ask if there is any way to call the zscript function in child window?
e.g.
<window>
<zscript>
public void callChildFunc()
{
// Any way to call child window test() function ????
}
</zscript>
<window>
<zscript>
public void test()
{
alert("Test");
}
</zscript>
</window>
</window>
I don't think you can call win.test() in above case.
timshiu, if I were you I will
1. write the test function as a global function and pass any local variable as function arguments.
or 2. use post event from one to another, and handle the event locally.
Thanks for your advice.
Actually, my scenario is that I want to create a macro component which can be plugged to any zul page.
There are window components on both the marco component page and zul page, and I need to call a function in the child window which will access the values of the components inside the child window.
1. If the zscript is inside the child window, we can get the values of components by the .value directly.
But the parent window cannot call the function in the child window directly.
2. If I place the zscript outside the child window and inside the marco component, I need to access the values of components by Path.getComponent().value method. Since the parent window can be different in different zul page and the window id is varied, the path for getComponent() cannot be hard-code in the marco component.
So, I would like to ask:
1) if there is any way to call the zscript function in child window? (It seems we cannot call the function in child window directly)
2) if there is any way to get the component in child window without the id of parent window?
Asked: 2009-06-10 10:48:42 +0800
Seen: 495 times
Last updated: Feb 04 '13