-
FEATURED COMPONENTS
First time here? Check out the FAQ!
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>
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>
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
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
Asked: 2008-11-11 11:24:52 +0800
Seen: 158 times
Last updated: Nov 13 '08