Write Java code in ZUML"

From Documentation
(Created page with '{{ZKDevelopersGuidePageHeader}} For fast prototyping, you can embed codes in ZUML page. By default, it's java. Keep in mind, it's simply java but interpreted by Beanshell. There…')
 
m (correct highlight (via JWB))
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
{{ZKDevelopersGuidePageHeader}}
 
{{ZKDevelopersGuidePageHeader}}
  
For fast prototyping, you can embed codes in ZUML page. By default, it's java. Keep in mind, it's simply java but interpreted by Beanshell. Therefore you can define variables, methods, event class inside <tt>zscript</tt>. Please refer to [[Getting_started#Write_java_code_in_you_ZUML | Write Java code in your ZUML]] for a simple example. Please also refer to [[Zscript%2C_java%2C_EL | Zscript, java, EL]] for some useful examples about zscript.
+
For fast prototyping, you can embed codes in ZUML page. By default, it's java. Keep in mind, it's simply java but interpreted by Beanshell. Therefore you can define variables, methods, event class inside <code>zscript</code>. Please refer to [[ZK_Developer's_Guide/ZK_in_Depth/Zscript,_java,_EL | Zscript, java, EL]] for some useful examples about zscript.
  
There are two ways to write <tt>zscript</tt>. First, inside <zscript></zscript>:
+
There are two ways to write <code>zscript</code>. First, inside <zscript></zscript>:
 
<source lang="xml" >
 
<source lang="xml" >
 
<zscript>
 
<zscript>

Latest revision as of 10:38, 19 January 2022

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


For fast prototyping, you can embed codes in ZUML page. By default, it's java. Keep in mind, it's simply java but interpreted by Beanshell. Therefore you can define variables, methods, event class inside zscript. Please refer to Zscript, java, EL for some useful examples about zscript.

There are two ways to write zscript. First, inside <zscript></zscript>:

<zscript>
//inside is zscript
//you can declare variable, function, and even Java class here.
</zscript>

Second, inside event handler.

<button onClick='alert("event handler for onXXX inside ZUML is also zscript")'/>



Last Update : 2022/01/19

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