Data Binding"

From Documentation
m (replace tt with code (via JWB))
Line 11: Line 11:
 
Basically, the syntax consists of an annotation name with comma-separated key-value pairs. The binder treats an annotation's attribute value as an EL expression, and sets an EL expression without a attribute name to default attribute name "value". All annotations must define default attribute's value.
 
Basically, the syntax consists of an annotation name with comma-separated key-value pairs. The binder treats an annotation's attribute value as an EL expression, and sets an EL expression without a attribute name to default attribute name "value". All annotations must define default attribute's value.
  
For each ZK Bind supported annotation, the way a binder evaluates an EL expression is slightly different. Some annotation's EL expressions are evaluated only once like <tt>@id</tt> and <tt>@init</tt>. some annotations have reserved attribute names, "before" and "after", like <tt>@load</tt> and <tt>@save</tt>.
+
For each ZK Bind supported annotation, the way a binder evaluates an EL expression is slightly different. Some annotation's EL expressions are evaluated only once like <code>@id</code> and <code>@init</code>. some annotations have reserved attribute names, "before" and "after", like <code>@load</code> and <code>@save</code>.
  
  
Line 17: Line 17:
  
  
* '''<tt>@</tt>''[AnnotationName]''<tt>( </tt> ''[EvaluateOnce EL-expression]''  <tt>) </tt> '''
+
* '''<code>@</code>''[AnnotationName]''<code>( </code> ''[EvaluateOnce EL-expression]''  <code>) </code> '''
  
 
;''[AnnotationName]''  
 
;''[AnnotationName]''  
Line 29: Line 29:
  
  
* '''<tt>@</tt>''[AnnotationName]''<tt>( </tt> ''[EL-expression]''  <tt>) </tt> '''
+
* '''<code>@</code>''[AnnotationName]''<code>( </code> ''[EL-expression]''  <code>) </code> '''
  
 
;''[AnnotationName]''  
 
;''[AnnotationName]''  
Line 35: Line 35:
  
 
;''[EL-expression]''  
 
;''[EL-expression]''  
:It could be any ZK allowed EL expression (an internal link to EL) without <tt> ${ } </tt> enclosed.
+
:It could be any ZK allowed EL expression (an internal link to EL) without <code> ${ } </code> enclosed.
  
  
  
  
* '''<tt>@</tt>''[AnnotationName]''<tt>( </tt> ''[EL-expression], [conditionKeyword]=[EvaluateOnce EL-expression]''  <tt>) </tt> '''
+
* '''<code>@</code>''[AnnotationName]''<code>( </code> ''[EL-expression], [conditionKeyword]=[EvaluateOnce EL-expression]''  <code>) </code> '''
  
 
;''[AnnotationName]''  
 
;''[AnnotationName]''  
Line 53: Line 53:
 
;''[EvaluateOnce EL-expression]''
 
;''[EvaluateOnce EL-expression]''
 
: The evaluation result must be one or more command name.
 
: The evaluation result must be one or more command name.
: Command name must correspond to the name specified in Java annotation <tt> @Command </tt> in a ViewModel.
+
: Command name must correspond to the name specified in Java annotation <code> @Command </code> in a ViewModel.
  
  
  
  
* '''<tt>@</tt>''[AnnotationName]''<tt>( </tt> ''[EL-expression], [arbitraryKey]=[EL-expression]''  <tt>) </tt> '''
+
* '''<code>@</code>''[AnnotationName]''<code>( </code> ''[EL-expression], [arbitraryKey]=[EL-expression]''  <code>) </code> '''
  
 
;''[AnnotationName]''  
 
;''[AnnotationName]''  

Revision as of 14:13, 12 January 2022

Stop.png This article is out of date, please refer to zk-mvvm-book/8.0/syntax/data_binding for more up to date information.


In the following sections, we'll cover ZK Bind's annotations used on a ZUL. They are all used in component's attribute and have general format described in Annotate in ZUML:

@AnnotationName(attr-value1, attr-name2=attr-value2)

@AnnotationName(attr-name1={attr-value1-1, attr-value1-2}, attr-name2=attr-value2)

Basically, the syntax consists of an annotation name with comma-separated key-value pairs. The binder treats an annotation's attribute value as an EL expression, and sets an EL expression without a attribute name to default attribute name "value". All annotations must define default attribute's value.

For each ZK Bind supported annotation, the way a binder evaluates an EL expression is slightly different. Some annotation's EL expressions are evaluated only once like @id and @init. some annotations have reserved attribute names, "before" and "after", like @load and @save.



Subsections:



Last Update : 2022/01/12

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