Yes. Only with the commands you could have problems because you do not give id of viewmodel there.
chillworld ( 2015-07-24 20:15:32 +0800 )edit-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Is it possibe to have more then one viewModel on a page? Like <window border="none" viewmodel="@id('vm') @init('mainWindowClass')" apply="org.zkoss.bind.BindComposer">
<tabbox> <tabs><tab label="First"><tab label="Second"></tabs> <tabpanels><tabpanel apply="org.zkoss.bind.BindComposer" viewmodel="@id('vm1') @init('tabFirstClass')"> <label value="@load(vm.username)"><label value="@load(vm1.status)"><button onclick="@command(vm1.update)"/></tabpanel> <tabpanel apply="org.zkoss.bind.BindComposer" viewmodel="@id('vm2') @init('tabSecondClass')"> <label value="@load(vm.username)"><label value="@load(vm2.task)"><button onclick="@command(vm2.update)"/></tabpanel> <tabpanels><tabbox> <button onclick="@command(vm.update)"/><window>
yes, as long you keep your id's different, you will have no problems.
it is this for sure?
Yes. Only with the commands you could have problems because you do not give id of viewmodel there.
chillworld ( 2015-07-24 20:15:32 +0800 )editAsked: 2015-07-21 11:59:39 +0800
Seen: 21 times
Last updated: Jul 24 '15