Activates Data Binding Manager
From Documentation
The Data Binding Manager can be activated by defining the page Initializer at the top of every page.
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" ?>
For example, the page may look like this:
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit"?>
<zk>
<window apply="org.zkoss.demo.MyComposer">
</window>
</zk>
Ever since the release of ZK 5.0.8 there is a newer and cleverer way in which users can adopt to achieve the same outcome – by defining a dedicated Composer – AnnotateDataBindingComposer. The page using this way may look like
<zk>
<window apply="org.zkoss.demo.MyComposer, org.zkoss.zkplus.databind.AnnotateDataBindingComposer">
</window>
</zk>
For more information, please refer to the relative blog post Databinding Composer
This initiator class does the following things:
- Creates an AnnotateDataBinder instance.
- Sets the AnnotateDataBinder instance as a variable with the name "binder" stored in the component as specified in arg0 "component-path".(if arg0 is not specified, use Page instead.)
- Calls DataBinder.loadAll() to initiate all UI components from the associated data source.
Version History
Version | Date | Content |
---|---|---|