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.

[ 29 ]<br />

Chapter 1<br />

It depends on the component whether an event is supported or not. It's noteworthy<br />

to say that an event is sent after the content of the component is updated.<br />

ZUML – <strong>ZK</strong> User Interface Markup Language<br />

The first thing a new <strong>ZK</strong> developer is confronted with is the ZUML (<strong>ZK</strong> User<br />

Interface Markup Language). It's noteworthy to say that this is not a new proprietary<br />

language; it's just an XML with namespace.<br />

There are at least three namespaces that are important for working with <strong>ZK</strong>:<br />

http://www.zkoss.org/2005/zul The XUL component set<br />

http://www.w3.org/1999/xhtml The XHTML component set<br />

http://www.zkoss.org/2005/zk <strong>ZK</strong>-specific attributes<br />

Inside a ZUML page, we can use for example: EL expressions, Java, JavaScript, Ruby,<br />

and Groovy.<br />

Where is the session?<br />

In some situations it could be faster to place some zscripts into the page,<br />

and for that we may want to access the session or some other object (for<br />

example the page itself).<br />

In such situations there are some implicit objects that can be<br />

accessed in the pages. The objects are: self, spaceOwner,<br />

page, desktop, session, componentScope, spaceScope,<br />

pageScope, desktopScope, sessionScope, applicationScope,<br />

requestScope, arg, each, forEachStatus, and event.<br />

You can use these objects in a zscript block, or in an element ().<br />

If you need information about the current execution you could use the org.<br />

zkoss.zk.ui.Execution interface. If you are in a component use getDesktop().<br />

getExecution(). When you don't have any component reference use the static<br />

method, getCurrent() from the class org.zkoss.zk.ui.Executions. After this<br />

introduction to ZUML, we present some important points in ZUML.

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

Saved successfully!

Ooh no, something went wrong!