0

many viewmodel definitions in one page

asked 2015-07-21 11:59:39 +0800

IaroslavTsaryk gravatar image IaroslavTsaryk
1

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>

delete flag offensive retag edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2015-07-21 21:18:45 +0800

chillworld gravatar image chillworld flag of Belgium
5367 4 9
https://github.com/chillw...

yes, as long you keep your id's different, you will have no problems.

link publish delete flag offensive edit
0

answered 2015-07-24 11:49:25 +0800

lewerrkinna gravatar image lewerrkinna
1

it is this for sure?

link publish delete flag offensive edit

Comments

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
Your answer
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
1 follower

RSS

Stats

Asked: 2015-07-21 11:59:39 +0800

Seen: 21 times

Last updated: Jul 24 '15

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