-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I have build a way to simplify the communication of the main view with possible custom Message Boxes.
For example, when I want to update a row in a grid, I open a modal window (custom box) with the form.
The problem is that some information needs to pass between the "main view" and the "custom box" maintaining the use and consistency of binder information.
For that I usually invoke "command methods" with org.zkoss.bind.Binder.postCommand(...). Although this works fine, it seems to me that is a complex way (relative to simple method invoke) for my simple use case.
With that I also have a lot of other help code to create the "custom box" programmatically, to get the binder from, and the top component.
So, because I create the "custom box" view in the "main view" code, I already have direct access to the "custom box" command methods. Also, since the "main view" is the parent and the owner of the "custom box", it makes sence to me to invoke the methods directly, instead of post a command!
Is there any way to simplify the process of transmitting information between ViewModels without postCommand?
check these: http://books.zkoss.org/wiki/SmallTalks/2012/January/MVVMExtension:AccessUIComponentsInside_ViewModel http://books.zkoss.org/wiki/ZK%20Developer's%20Reference/MVVM/Advanced/Communication%20between%20ViewModel%20and%20Composer
Asked: 2012-08-09 10:13:52 +0800
Seen: 74 times
Last updated: May 15 '13