Last modified by Pascal Robert on 2010/09/19 10:29

From version 4.1
edited by Pascal Robert
on 2007/09/03 17:06
Change comment: There is no comment for this version
To version 7.1
edited by Pascal Robert
on 2010/09/19 10:29
Change comment: Migrated to Confluence 5.3

Summary

Details

Page properties
Title
... ... @@ -1,1 +1,1 @@
1 -Web Applications-Development-WO Component-Binding Synchronization
1 +Development-WO Component-Binding Synchronization
Parent
... ... @@ -1,0 +1,1 @@
1 +How-tos
Tags
... ... @@ -1,0 +1,1 @@
1 +wikitodo
Content
... ... @@ -1,6 +1,6 @@
1 1  == Overview ==
2 2  
3 -When you create a subclass of WOComponent, the default configuration is to have all of your bindings automatically synchronized. Binding synchronization is the process of getting and setting parent and chldren .wod file bindings during the request-response loop. While binding synchronization is very convenient, the one downside is that your binding get and set methods can be called multiple times (as many as six) during the request-response loop. As a result, you should be careful about potential performance problems inside of get and set methods. If you would rather avoid the potential performance issues, it is possible to disable automatic binding synchronization in your component by simply overriding the synchronizesVariablesWithBindings method to return false as in the below example:
3 +When you create a subclass of WOComponent, the default configuration is to have all of your bindings automatically synchronized. Binding synchronization is the process of getting and setting parent and chldren .wod file bindings during the request-response loop. While binding synchronization is very convenient, the one downside is that your binding get and set methods can be called multiple times (as many as six) during the request-response loop. As a result, you should be careful about potential performance problems inside of get and set methods. If you would rather avoid the potential performance issues, it is possible to disable automatic binding synchronization in your component by simply overriding the synchronizesVariablesWithBindings method to return false as in the below example:
4 4  
5 5  {{code}}
6 6  
... ... @@ -14,7 +14,7 @@
14 14  
15 15  == WOComponentContent ==
16 16  
17 -Because of the way WOComponentContent works, binding is often "backwards" from your intuition (often it ends up that your wrapper pushes its title value into your page instead of the other way around). One way to make your template wrapper component behave the way you expect is to turn off automatic binding synchronization:
17 +Because of the way WOComponentContent works, binding is often "backwards" from your intuition (often it ends up that your wrapper pushes its title value into your page instead of the other way around). One way to make your template wrapper component behave the way you expect is to turn off automatic binding synchronization:
18 18  
19 19  {{code}}
20 20  
... ... @@ -53,8 +53,8 @@
53 53  === wojingo ===
54 54  
55 55  If you use lazy initialization in your binding accessor methods as described above, you should also make the component
56 -stateless. If you do not make the component stateless you will find that your component may display incorrect values when
57 -used in a WORepetition. This situation occurs when the WORepetition's list is changed via a component action and null is returned. The existing nested component will be reused and the values in the original list will be displayed.
56 + stateless. If you do not make the component stateless you will find that your component may display incorrect values when
57 + used in a WORepetition. This situation occurs when the WORepetition's list is changed via a component action and null is returned. The existing nested component will be reused and the values in the original list will be displayed.
58 58  
59 59  Make the component stateless and override its reset method, setting all instance variables to null. This will make the
60 -component behave as expected.
60 + component behave as expected.
XWiki.XWikiComments[0]
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.probert
Comment
... ... @@ -1,0 +1,1 @@
1 +Should we merge or at least link this page with the Stateless page?
Date
... ... @@ -1,0 +1,1 @@
1 +2011-02-22 10:52:12.0