Wire Variables"
From Documentation
Line 13: | Line 13: | ||
=zscript and Variable Resolver= | =zscript and Variable Resolver= | ||
+ | |||
+ | By default, variables defined in both zscript and variable resolvers will be checked<ref>It will be default to '''false''' in ZK 6 for better performance.</ref>. There might be some performance penalty if you have too much zscript code, or your variable resolver is too slow. | ||
+ | |||
+ | You could turn them off by passing false to the second and third argument of <javadoc method="GenericForwardComposer(char, boolean, boolean)">org.zkoss.zk.ui.util.GenericForwardComposer</javadoc>: | ||
+ | |||
+ | <source lang="java"> | ||
+ | public class MyComposer extends GenericForwardComposer { | ||
+ | public MyComposer() { | ||
+ | super('$', false, false); | ||
+ | } | ||
+ | } | ||
+ | </source> | ||
+ | |||
+ | <blockquote> | ||
+ | ---- | ||
+ | <references/> | ||
+ | </blockquote> | ||
+ | |||
=ID Space= | =ID Space= | ||
Revision as of 07:12, 12 November 2010
Wiring Sequence
GenericForwardComposer will wire members defined in the composer. Here is the sequence:
- It searches any setter if its name matches any of the following
- Any fellow with the same name (Component.getFellow(String))
- Any variable defined in Page.addVariableResolver(VariableResolver) with the same name
- Any variable defined in zscript with the same name
- Any implicit object with the same name
- Then, it searches any field to see if it matches any fellow, any variable,... the same as the above.
zscript and Variable Resolver
By default, variables defined in both zscript and variable resolvers will be checked[1]. There might be some performance penalty if you have too much zscript code, or your variable resolver is too slow.
You could turn them off by passing false to the second and third argument of GenericForwardComposer.GenericForwardComposer(char, boolean, boolean):
public class MyComposer extends GenericForwardComposer {
public MyComposer() {
super('$', false, false);
}
}
- ↑ It will be default to false in ZK 6 for better performance.
ID Space
Version History
Last Update : 2010/11/12
Version | Date | Content |
---|---|---|