23.12.2012 Views

ZK Developer's Guide

ZK Developer's Guide

ZK Developer's Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Another area of application is the possibility of iterating over components, or<br />

conditional evaluation. For that zk elements supports the following attributes:<br />

•<br />

•<br />

•<br />

forEach<br />

if<br />

unless<br />

A small example of usage is as follows:<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

[ 33 ]<br />

Chapter 1<br />

The zscript element is used for embedding Java code into ZUML pages. At the<br />

time of page evaluation the code will be interpreted by the BeanShell (http://www.<br />

beanshell.org). It's possible to embed Java code directly between the opening<br />

and closing zscript tags. Another way is to use the src attribute of the zscript<br />

element. In this attribute, you could specify a URI to a file, which contains the Java<br />

code. The zscript element supports conditional evaluation with the help of the if<br />

and unless attributes.<br />

Beyond zscript you could use EL (Expression Language) Expressions in<br />

your <strong>ZK</strong> pages.<br />

The attribute element defines an attribute of the enclosing element. We have used<br />

this <strong>ZK</strong> Element in the "Hello World" example.<br />

<br />

<br />

...<br />

<br />

<br />

One area of application is event listeners. The attribute element supports<br />

conditional evaluation with if and unless, too.<br />

The custom-attributes element is used to define an object in a special scope (for<br />

example, page scope).

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!