Write Java code in ZUML

From Documentation

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>:

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

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.