-
FEATURED COMPONENTS
First time here? Check out the FAQ!
1 | initial version | |
It occurs to me that maybe you aren't aware that someFile.zul doesn't need it's own viewModel. As an included zul, it automatically has access to Overview.zul's viewmodel. So, in someFile.zul, you can just use overviewVM.folders in a component. You should look at any included zul as though it is in the same document as parent zul. No difference.
But, as a general principle of communicating between viewmodels, there are a few options. Personally, I would use one of these two techniques:
1) Push the folders object from viewmodel1 to viewmodel2 via an event queue. See here.
2) Make the folders object accessible via a session level attribute.
ViewModel1
Sessions.getCurrent().setAttribute("folders", folders);
Then, in ViewModel2, you can retrieve it via:
List<Folder> folders = Sessions.getCurrent().getAttribute("folders");
I don't know what type of object your folders is, so I just used List<folder> for an example.
Ron