Define class and methods in zscript"

From Documentation
m (Created page with '{{ZKDevelopersGuidePageHeader}} Thanks to the power of BeanShell, the implementation of Java classes can be done in zscript as follows. <source lang="xml" > <zscript> publi…')
 
m (correct highlight (via JWB))
 
Line 11: Line 11:
 
</source>
 
</source>
  
And you can define methods in <tt>zscript</tt>
+
And you can define methods in <code>zscript</code>
 
<source lang="xml" >
 
<source lang="xml" >
 
<window>
 
<window>

Latest revision as of 10:41, 19 January 2022

Define class and methods in zscript


Stop.png This documentation is for an older version of ZK. For the latest one, please click here.


Thanks to the power of BeanShell, the implementation of Java classes can be done in zscript as follows.

<zscript>
    public class MyWindow extends Window {    
    }    
</zscript>
<window use="MyWindow"/>

And you can define methods in zscript

<window>
	<zscript><![CDATA[  
		public void sayHello(){
			alert("hello");
		}
	]]>
	</zscript>
	<button label="Say Hello!" onClick="sayHello()" />
</window>



Last Update : 2022/01/19

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