An Example"
From Documentation
(Created page with '{{ZKDevelopersGuidePageHeader}} In the following example, you can see the lifecycle difference of EL and zscript. <source lang="xml" > <window> <button label="${btn2.label}" …') |
m (correct highlight (via JWB)) |
||
Line 10: | Line 10: | ||
</source> | </source> | ||
− | In component creation phase, component is evaluated by sequence in file, it reserves XML tree structure, parent is always evaluated before children. When < | + | In component creation phase, component is evaluated by sequence in file, it reserves XML tree structure, parent is always evaluated before children. When <code>label="${btn2.label}"</code> is evaluated, <code>btn2</code> is not evaluated yet, therefore it gets <code>null</code>. <code>zscript</code> is evaluated at rendering phase, <code>btn2</code> is already created, therefore it knows how to find <code>btn2</code> |
{{ ZKDevelopersGuidePageFooter}} | {{ ZKDevelopersGuidePageFooter}} |
Latest revision as of 10:35, 19 January 2022
This documentation is for an older version of ZK. For the latest one, please click here.
In the following example, you can see the lifecycle difference of EL and zscript.
<window>
<button label="${btn2.label}" id="btn1" onClick='btn2.label="changed"'/>
<button label="ok" id="btn2"/>
</window>
In component creation phase, component is evaluated by sequence in file, it reserves XML tree structure, parent is always evaluated before children. When label="${btn2.label}"
is evaluated, btn2
is not evaluated yet, therefore it gets null
. zscript
is evaluated at rendering phase, btn2
is already created, therefore it knows how to find btn2