-
FEATURED COMPONENTS
First time here? Check out the FAQ!
1 | initial version | |
Hi, I have a page with 2 view models:
<?page title="Manage stands" contentType="text/html;charset=UTF-8"?>
<div apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('com.mycompany.FirstViewModel')">
<!-- A lot of unimportant stuff -->
<tabbox>
<tabs>
<tab label="Tab1" ></tab>
<!-- Other unimportant tabs -->
</tabs>
<tabpanels>
<tabpanel>
<include src="inc/other.zul" p="@ref(vm.selected)" pid="@ref(vm.selected.id)" ></include>
</tabpanel>
</tabpanels>
</tabbox>
</div>
The include is like this:
<window>
<label id="sid" value="@load(pid)" ></label>
<div apply="org.zkoss.bind.BindComposer"
viewModel="@id('vms') @init('com.mycompany.SecondViewModel')">
<listbox model="@id('vars') @load(p.someList)"
selectedItem="@bind(vms.selected)"
emptyMessage="No data in list">
<!-- Template and stuff -->
</listbox>
<label id="sid1" value="@load(pid)" ></label>
</div>
</window>
The problem is that once I define the second viewModel, all the external references are inaccessible: I have a value for the first label, but I have no values for the listbox or the second label. Is there a way to do that? I tried with no success to do this:
<div apply="org.zkoss.bind.BindComposer"
viewModel="@id('vms') @init('com.mycompany.SecondViewModel')" list="@ref(p.someList)">
<listbox model="@id('vars') @load(list)"
selectedItem="@bind(vms.selected)"
emptyMessage="No data in list">