-
FEATURED COMPONENTS
First time here? Check out the FAQ!
My example:
<borderlayout id="lay" width="100%" height="100%">
<north id="nor" size="100px" border="0px">
</north>
<west width="120px" collapsible="true" title="west" splittable="true">
</west>
<east width="120px" collapsible="true" title="east">
</east>
<south size="40px" border="0px">
</south>
<center id="cen" border="0px">
<vbox>
<include src="win1.zul"/> ********** sub-window1
<include src="win2.zul"/> ********** sub-window2
</vbox>
</center>
</borderlayout>
----win1.zul-------------------------------
<window id="win1">
<testbox id="t1" value="t1"/>
</winodw>
----win2.zul--------------------------------
<window id="win2" apply="my.win2">
<button label="clk" forward="onClick=onGO"/>
</window>
--win2.java---------------------------
public class win2 extends GenericComposer{
public void onGO()
{
******* sub-window2 get sub-window1's testbox t1*************
******* try
Textbox t=null;
t=((Textbox)Path.getComponent("/win1/t1");//!!!!!!FAILED
t=((Textbox)Path.getComponent("//win1/t1");//!!!!!!FAILED
t=((Textbox)Path.getComponent("/lay/cen/win1/t1");//!!!!!!FAILED
but , how to do? please tell me.
}
}
Hi....
I am working with some includes in my application too. It is not the same that you example but... maybe you get it giving id's to your includes and using it in that way:
<include id="include_1" ... >
<include id="include_2" ... >
and then...
Path.getComponent("/yourPageId/include_1/t1"); Path.getComponent("/yourPageId/include_2/yourButtonId");
It worked in my case, hope for you too.
Look that: http://books.zkoss.org/wiki/ZK_Developer's_Reference/UI_Composing/ID_Space (http://books.zkoss.org/wiki/ZKDeveloper'sReference/UIComposing/IDSpace)
Asked: 2011-11-08 12:32:32 +0800
Seen: 284 times
Last updated: Feb 05 '13