-
FEATURED COMPONENTS
First time here? Check out the FAQ!
hii guys,,,
please help me to find the way to bind a component from "Include" tag..
normally, we can bind teh component from zul page just by defining the attribute on the Composer Class..
let say ,,, private TextBox txt;
in this case i use "Include" Tag
for Example :
<window id="myWin" Apply="MyComposer">
<include src = "cihuy.zul"/>
</window>
how can i bind the componen in "cihuy.zul" from MyComposer;
is it possible??
thx before for helping.
Regards,
Aldian Bagya
@SHERKHAN Yes, We can !!
ZK rocks !!!!!!
inc.zul
<zk> <textbox id="mytext" /> </zk>
<zk> <include id="myinc" src="inc.zul"/> </zk>
//Define your component in Composer
// Component [include id]$[component id]
Composer
Textbox myinc$mytext;
take a look
http://docs.zkoss.org/wiki/New_Features_of_ZK_5.0#Wiring_components_in_a_nested_ID_space
if you already get the component object (like the example Textbox myinc$mytext;)
you can add listener to it
myinc$mytext.addEventListener("onClick", new EventListener() { public void onEvent(Event event) throws Exception { alert("Awesome!!!"); } });
I love that feature in ZK 5.0!
However, could anyone tell me:
<zk> <textbox id="mytext" /> </zk>
<zk> <include id="myinc" src="inc.zul"/> </zk>
@enix0907 @yohann,
Yes. It depends on the include mode. Defer mode will not load the included page until rendering phase which is way behind the doAfterCompose(). Thus no way you can access the components of the included page in doAfterCompose() if in defer mode.
Asked: 2010-08-11 04:37:59 +0800
Seen: 1,631 times
Last updated: Apr 20 '17