An Example

From Documentation
Revision as of 02:27, 20 July 2010 by Char (talk | contribs) (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}" …')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Stop.png 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



Last Update : 2010/07/20

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