This is a summary of my reading and understanding of ZK Essentials for later reference
ZK Essentials Document (in ZK Documentation)
(Notes taken mainly from ZK Essentials)
Component Based UI
ZUL - component can be declared in .zul file, the XML format of which, in my opinion, fits better to the tree structure of a UI interface than Java
Component - components are created as POJO on sever, each was either given an ID in declaration, or given a UUID automatically
Page - page is not component (not implementing the interface) but a space holder in browser; when user requests a ZUL page, a page is automatically created
Desktop - desktop may contains one or more pages; it's automatically created when a Page is created; it represents the browser (my understanding)
Component Organization
ID Space - ID Space is a way to group components into a manageable collection; components in the same ID Space can call each other by ID using the getFellow method
Space Owner - Space Owner is component implementing the IdSpace interface; Window and Page are Space Owners by default; component can find its owner by getSpaceOwner method
Component Access
getFellow - get a fellow by ID, get a fellow Space Owner then get a child of that Space Owner with another getFellow
Path - Path has the utility method getComponent which takes the relative path as argument
Traversing - use getFirstChid, getNextSibling, etc
Event Handling and Wiring
Handling - by default, event information (event type, position, component, etc.) sent to server and handled from server; optionally event can be handled from client directly;
Wiring in ZUL - event handling code can be specified in ZUI using EL (Expression Language); Java code can be written in the "onClick" attribute, and be interpreted by BeanShell; not recommended for performance sensitive application (interpretation dynamically); also not recommended to mix UI with execution logic;
Declarative Wiring in Controller - declare "apply = name.controller.ControllerClassName"; at the ControllerClassName class, extends from a base SelectorComposer class to wire variables and listen to events, use annotation to wire the component with a member of the controller, and wire event to a method of the controller;
Dynamic Wiring - use method such as "addEventListener"
ZK MVC and Session
SelectorComposer - Controller needs to extend this class; this class auto-wire UI objects to the controller object; the java object will be the controller
apply - <window id="loginWin" ...... apply="demo.web.ui.ctrl.LoginViewCtrl"