0

How to bind Component from Include tag

asked 2010-08-11 04:37:59 +0800

aldian gravatar image aldian
33 1

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

delete flag offensive retag edit

11 Replies

Sort by ยป oldest newest

answered 2010-08-11 07:49:36 +0800

SHERKHAN gravatar image SHERKHAN
231 3

You can't.

You can apply a new composer on you zul page (cihuy.zul) or use a Macro... Macro is the best way I think.

link publish delete flag offensive edit

answered 2010-08-13 02:38:15 +0800

RyanWu gravatar image RyanWu
533 2
about.me/flyworld

@SHERKHAN Yes, We can !!

ZK rocks !!!!!!

inc.zul

<zk>
<textbox id="mytext" />
</zk>

main.zul
<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

link publish delete flag offensive edit

answered 2010-08-13 07:25:55 +0800

aldian gravatar image aldian
33 1

thx Ryan,,

how about if we wan to bind the event from button..
like onClick$btnid

link publish delete flag offensive edit

answered 2010-08-15 02:18:17 +0800

RyanWu gravatar image RyanWu
533 2
about.me/flyworld

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!!!");
			}
		});

link publish delete flag offensive edit

answered 2010-08-19 22:10:11 +0800

enix0907 gravatar image enix0907
129 1
http://sites.google.com/s...

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>



that Textbox myinc$mytext; even can be used in public void doAfterCompose(Component win) method (during Component Creation Phase)? Does this depend on Include mode? If it is Instant mode, there is no problem at all? How about Defer mode?

Thank you for the answer :)

link publish delete flag offensive edit

answered 2011-02-23 10:46:20 +0800

yohann gravatar image yohann
57

Hi,

I have the same problem, i'am using "defer" mode and it is not possible to access included component during doAfterCompose. Have you found a solution ?

link publish delete flag offensive edit

answered 2012-02-28 10:14:09 +0800

Neus gravatar image Neus
1415 14

Hi,
Is it possible to access the include component from SelectorComposer? the syntax include_id$component_id doesn't work!

Thank you!

link publish delete flag offensive edit

answered 2012-02-29 07:56:12 +0800

Neus gravatar image Neus
1415 14

I found the solution

@Wire("#id_include #id_component_in_include")
protected Div PanelHerramientas;

Thank you

link publish delete flag offensive edit

answered 2012-02-29 08:13:00 +0800

henrichen gravatar image henrichen
3869 2
ZK Team

@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.

link publish delete flag offensive edit

answered 2016-02-19 09:48:38 +0800

WilliamB gravatar image WilliamB
1609 1 6

How can I access it from the zul? I have a zul with an include and i need my parent page to access a component inside the include ?

How would I do that in the main zul ?

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2010-08-11 04:37:59 +0800

Seen: 1,631 times

Last updated: Apr 20 '17

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More