Implicit Objects

From Documentation

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


Overview

For scripts embedded in a ZUML page, there are a set of implicit objects that enable developers to access components more efficiently. It's also a mechanism to pass data inter page, application. These objects are available to the Java codes included by the zscript element and the attributes for specifying event listeners. They are also available to EL expressions.

For example, self is an instance of Component to represent the component being processing. In the following example, you could identify the component in an event listener by self.

 <button label="Try" onClick="alert(self.label)"/>

Similarly, event is the current event being processed by an event listener. Thus, the above statement is equivalent to

<button label="Try" onClick="alert(event.target.label)"/>





Last Update : 2022/01/19

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