Revision history [back]

click to hide/show revision 1
initial version

answered 2012-11-17 02:37:09 +0800

rdgrimes gravatar image rdgrimes

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

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