Wire Components"
From Documentation
(no need to call Selectors.wireVariables() in init method) |
m |
||
Line 17: | Line 17: | ||
</source> | </source> | ||
− | + | ||
Revision as of 05:01, 25 April 2012
Although the original design principle of MVVM pattern is that ViewModel doesn't have any reference to UI components, ZK provide ways to retrieve UI components on a ZUL in a ViewModel. One is passing components as parameters in binding expression. Another is to wire components by Selector. This way enables you to wire components with @Wire like you do in a SelectorComposer.
Example to wire components in a ViewModel
public class SearchAutowireVM{
//UI component
@Wire("#msgPopup")
Popup popup;
@Wire("#msg")
Label msg;
}
Version History
Version | Date | Content |
---|---|---|
6.0.0 | February 2012 | The MVVM was introduced. |