-
FEATURED COMPONENTS
First time here? Check out the FAQ!
![]() | 1 | initial version | |
For most of my zul pages I use mvvm. I declare a view model as follows
<window title="Contact List" border="normal" apply="org.zkoss.bind.BindComposer" viewmodel="@id('vm') @init('com.MyVM')" hflex="1" vflex="1" contentstyle="overflow:auto">
I just discovered that it appears possible for each ui component to have it's own ViewModel in a zul page.
I will like to ask
what are the usage scenarios for using more than one view model in a zul page ?
is it possible for two view models in the same page to pass data to each other ?
or at least can a parent view model supply a parameter to child view model ?
If this is possible how can I declare such functionality in a zul ?
My understanding is that the parent view model is the view model I bind to my window ui component then other view models that I bind to other ui's e.g. grid in the page are the child view models.
I would appreciate clarity on the above as it can open up many possibilities as to how I develop my application.
![]() | 2 | No.2 Revision |
For most of my zul pages I use mvvm. I declare a view model as follows
<window title="Contact List" I just discovered that it appears possible for each ui component to have it's own ViewModel in a zul page.
I will like to ask
what are the usage scenarios for using more than one view model in a zul page ?
is it possible for two view models in the same page to pass data to each other ?
or at least can a parent view model supply a parameter to child view model ?
If this is possible how can I declare such functionality in a zul ?
My understanding is that the parent view model is the view model I bind to my window ui component then other view models that I bind to other ui's e.g. grid in the page are the child view models.
I would appreciate clarity on the above as it can open up many possibilities as to how I develop my application.