Distinguish zscript from EL"
From Documentation
Maya001122 (talk | contribs) m (Created page with '{{ZKDevelopersGuidePageHeader}} Keep in mind, EL is enclosed by ${}. <tt>${self.label}</tt> is EL. <source lang="xml" > <window> <button label="ok" id="${self.label}"/> ${o…') |
m (correct highlight (via JWB)) |
||
Line 3: | Line 3: | ||
Keep in mind, EL is enclosed by ${}. | Keep in mind, EL is enclosed by ${}. | ||
− | < | + | <code>${self.label}</code> is EL. |
<source lang="xml" > | <source lang="xml" > | ||
<window> | <window> | ||
Line 11: | Line 11: | ||
</source> | </source> | ||
− | < | + | <code>alert(self.label)</code> is not EL, it's a piece of <code>zscript</code> |
<source lang="xml" > | <source lang="xml" > | ||
<window> | <window> | ||
Line 18: | Line 18: | ||
</source> | </source> | ||
− | Although they both look alike, but EL and zscript have different life cycle, EL is not available at certain phase. Therefore in some cases, you can't use EL but < | + | Although they both look alike, but EL and zscript have different life cycle, EL is not available at certain phase. Therefore in some cases, you can't use EL but <code>zscript</code>. |
<source lang="xml" > | <source lang="xml" > |
Latest revision as of 10:38, 19 January 2022
This documentation is for an older version of ZK. For the latest one, please click here.
Keep in mind, EL is enclosed by ${}.
${self.label}
is EL.
<window>
<button label="ok" id="${self.label}"/>
${ok.label}
</window>
alert(self.label)
is not EL, it's a piece of zscript
<window>
<button label="ok" onClick='alert(self.label)'/>
</window>
Although they both look alike, but EL and zscript have different life cycle, EL is not available at certain phase. Therefore in some cases, you can't use EL but zscript
.
<window>
<!-- It's wrong, for java don't accept syntax as ${}-->
<button label="ok" onClick='alert(${self.label})'/>
</window>