access UI component by ID"
From Documentation
Maya001122 (talk | contribs) m (Created page with '{{ZKDevelopersGuidePageHeader}} <tt>zscript</tt> can access UI component by ID, in the following example, <source lang="xml" > <window id="win_1"> <zscript><![CDATA[ win_1…') |
m (correct highlight (via JWB)) |
||
Line 1: | Line 1: | ||
{{ZKDevelopersGuidePageHeader}} | {{ZKDevelopersGuidePageHeader}} | ||
− | < | + | <code>zscript</code> can access UI component by ID, in the following example, |
<source lang="xml" > | <source lang="xml" > | ||
<window id="win_1"> | <window id="win_1"> | ||
Line 16: | Line 16: | ||
</source> | </source> | ||
− | To access ui component in java code, you can use < | + | To access ui component in java code, you can use <code>Path.getComponent()</code> to obtain the mapping java object. |
<source lang="java" > | <source lang="java" > |
Latest revision as of 10:41, 19 January 2022
This documentation is for an older version of ZK. For the latest one, please click here.
zscript
can access UI component by ID, in the following example,
<window id="win_1">
<zscript><![CDATA[
win_1.title="given by zscript";
]]>
</zscript>
</window>
the result will be:
given by zscript
To access ui component in java code, you can use Path.getComponent()
to obtain the mapping java object.
Window win = (Window)Path.getComponent("/win_1");
win.setTitle("given by java");