0

cross includes

asked 2008-11-11 11:24:52 +0800

huubf gravatar image huubf
69 1

updated 2008-11-11 11:26:01 +0800

Does anyone know how to access ids in parts that are included?

the following Example is not working
________
*menu.zul
========
<window>

<label id="original" value="CHANGE" />

</window>

*main.zul
========
<window>
<include src="menu.zul"/>
<label id="copy" />
<zscript>

copy.value = original.value;
original.value="new value";

</zscript>
</window>

delete flag offensive retag edit

4 Replies

Sort by ยป oldest newest

answered 2008-11-13 01:34:31 +0800

robertlee gravatar image robertlee
561

Huub,
You can try to use the setAttribute method under implicit objects, this is a easier way to access data across different pages, whist keeping your code concise.

Have a look under

"ZK Elements" in the developers' guide:
http://www.zkoss.org/doc/devguide/

Regards,
Robert Lee

link publish delete flag offensive edit

answered 2008-11-11 15:17:27 +0800

huubf gravatar image huubf
69 1

updated 2008-11-11 15:58:22 +0800

But, it's not all components I use, i also have 'normal' includes, and i have to navigate to the ID in another include
        MAIN.ZUL
             /\
MENU.ZUL CONTENT.ZUL

i want to update a status field in MENU from content

i found i have to do the following in CONTENT.ZUL: (if anyone knows a diffenrent approach...)

children=wat.getDesktop().getPage("menu").getFellow("menu").getChildren();
status=null;
for (Iterator it = children.iterator(); it.hasNext();) {
final Object child = it.next();
if (child.getId().equals("status")) {
status = child;
break;
}
}
if(status !=null) status.getFellow("statusomschrijving").setValue("hoppa");


I solved my issue though

Regards, Huub

link publish delete flag offensive edit

answered 2008-11-11 13:29:08 +0800

huubf gravatar image huubf
69 1

updated 2008-11-11 15:17:46 +0800

oke waaw now i get it

status.zul
==========

<vbox id="status" style="position:absolute; bottom:150px">
<label sclass="smaller" id="statusomschrijvingkop" value="aap"/>
<label sclass="smaller" id="statusomschrijving" value="noot" />
</vbox>

main.zul
========
<?xml version="1.0" encoding="UTF-8"?>
<?component name="status" macroURI="status.zul" inline="true"?>

<?page title="TEST"?>

<zk width="978px"
xmlns:h="http://www.w3.org/1999/xhtml">

<status />
<zscript>

status.statusomschrijving.value="mies";
</zscript>

</zk>

link publish delete flag offensive edit

answered 2008-11-11 11:47:24 +0800

robertlee gravatar image robertlee
561

Please have a look:
http://www.zkoss.org/doc/devguide-single/index.html#id475573

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: 2008-11-11 11:24:52 +0800

Seen: 158 times

Last updated: Nov 13 '08

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