Activates Data Binding Manager"

From Documentation
Line 6: Line 6:
 
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" ?>
 
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" ?>
 
</source>
 
</source>
 +
 +
For example, the page may looks like
 +
 +
<source lang="xml" >
 +
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit"?>
 +
<zk>
 +
    <window  apply="org.zkoss.demo.MyComposer">
 +
    </window>
 +
</zk
 +
</source>
 +
 +
After ZK 5.0.8 there is a new and cleverer way in which users can adopt to do achieve the same outcome – by defining a dedicated Composer – AnnotateDataBindingComposer. The page with this way may looks like
 +
 +
<source lang="xml" >
 +
<zk>
 +
<window  apply="org.zkoss.demo.MyComposer,org.zkoss.zkplus.databind.AnnotateDataBindingComposer">
 +
</window>
 +
</zk
 +
</source>
 +
 +
For more information, please refer to the relative blog post
 +
[http://blog.zkoss.org/index.php/2011/08/11/databinding-composer/ Databinding Composer]
  
 
This initiator class does the following things:
 
This initiator class does the following things:

Revision as of 07:33, 1 September 2011


Activates Data Binding Manager


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 looks like

<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit"?>
<zk>
    <window  apply="org.zkoss.demo.MyComposer">
    </window>
</zk

After ZK 5.0.8 there is a new and cleverer way in which users can adopt to do achieve the same outcome – by defining a dedicated Composer – AnnotateDataBindingComposer. The page with this way may looks 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:

  1. Creates an AnnotateDataBinder instance.
  2. 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.)
  3. Calls DataBinder.loadAll() to initiate all UI components from the associated data source.

Version History

Last Update : 2011/09/01


Version Date Content
     



Last Update : 2011/09/01

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.