define Variable in zscript and access by EL

From Documentation
Revision as of 10:41, 19 January 2022 by Hawk (talk | contribs) (correct highlight (via JWB))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
DocumentationZK Developer's GuideZK in DepthZscript, java, ELdefine Variable in zscript and access by EL
define Variable in zscript and access by EL

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

Variable defined in zscript can be easily accessed by EL.


The result shows 1:abc

To achieve the same result in java, you can rewrite it to

<window id="win_1" use="MyWindow">

And the java file:

import org.zkoss.zul.Window;

public class MyWindow extends Window {
	String var = "abc";
	public String getVar(){
		return var;

Note that ${win_1.var} will be mapped to MyWindow.getVar(). It's case sensitive. The mapping getter function will map first character of variable to upper case and append get in front of it.

Last Update : 2022/01/19

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