
SIMPLY RICH ZKTM The Developer's Guide Version 3.6.3 June 2009 Potix Corporation Revision 228 ZK: Developer's Guide Page 1 of 293 Potix Corporation Copyright © Potix Corporation. All rights reserved. The material in this document is for information only and is subject to change without notice. While reasonable efforts have been made to assure its accuracy, Potix Corporation assumes no liability resulting from errors or omissions in this document, or from the use of the information contained herein. Potix Corporation may have patents, patent applications, copyright or other intellectual property rights covering the subject matter of this document. The furnishing of this document does not give you any license to these patents, copyrights or other intellectual property. Potix Corporation reserves the right to make changes in the product design without reservation and without notification to its users. The Potix logo and ZK are trademarks of Potix Corporation. All other product names are trademarks, registered trademarks, or trade names of their respective owners. ZK: Developer's Guide Page 2 of 293 Potix Corporation Table of Contents 1. Introduction...............................................................................................................18 Traditional Web Applications...........................................................................................18 Ad-hoc AJAX Applications...............................................................................................18 ZK: What It Is ..............................................................................................................19 ZK: What It Is Not.........................................................................................................20 ZK: Limitations.............................................................................................................21 2. Getting Started..........................................................................................................22 Hello World!.................................................................................................................22 Interactivity..................................................................................................................22 The zscript Element.......................................................................................................23 The Scripting Language..............................................................................................24 The Scripting Codes in a Separate File.........................................................................24 The attribute Element....................................................................................................24 The EL Expressions........................................................................................................25 The id Attribute.............................................................................................................26 The if and unless Attributes............................................................................................26 The forEach Attribute.....................................................................................................27 The use and apply Attribute............................................................................................27 The use Attribute......................................................................................................28 The apply Attribute....................................................................................................28 Implement Java Classes in zscript...............................................................................29 The forward Attribute.....................................................................................................30 Create Components Manually..........................................................................................31 Developing ZK Applications without ZUML....................................................................32 Define New Components for a Particular Page...................................................................32 3. The Basics..................................................................................................................33 Architecture Overview....................................................................................................33 The Execution Flow....................................................................................................34 Components, Pages and Desktops...................................................................................34 Components.............................................................................................................34 Pages......................................................................................................................34 Page Title.............................................................................................................35 ZK: Developer's Guide Page 3 of 293 Potix Corporation Desktops..................................................................................................................35 The createComponents Method...............................................................................35 Forest of Trees of Components....................................................................................35 Component: a Visual Part and a Java Object.................................................................36 Identifiers................................................................................................................36 UUID.......................................................................................................................36 The ID Space................................................................................................................37 Namespace and ID Space...........................................................................................38 Variable and Functions Defined in zscript......................................................................38 zscript and EL Expressions......................................................................................39 Multi-Scope Interpreters.........................................................................................40 Single-Scope Interpreters.......................................................................................41 Multiple scripting Languages in One Page.................................................................42 getVariable versus getZScriptVariable......................................................................42 Events.........................................................................................................................42 Desktops and Event Processing.......................................................................................43 Desktops and the Creation of Components....................................................................43 ZUML and XML Namespaces............................................................................................43 4. The Component Lifecycle...........................................................................................45 The Lifecycle of Loading Pages........................................................................................45 The Page Initial Phase................................................................................................45 The Component Creation Phase...................................................................................45 The Event Processing Phase........................................................................................46 The Rendering Phase.................................................................................................46 The Lifecycle of Updating Pages......................................................................................46 The Request Processing Phase....................................................................................47 The Event Processing Phase........................................................................................47 The Rendering Phase.................................................................................................47 The Molds.....................................................................................................................47 Component Garbage Collection.......................................................................................48 5. Event Listening and Processing..................................................................................49 Add Event Listeners by Markup Languages.......................................................................49 Add and Remove Event Listeners by Program....................................................................49 Declare a Member.....................................................................................................49 Add and Remove Event Listeners Dynamically...............................................................50 Deferrable Event Listeners..........................................................................................50 ZK: Developer's Guide Page 4 of 293 Potix Corporation Add and Remove Event Listeners to Pages Dynamically..................................................51 The Invocation Sequence...........................................................................................52
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages293 Page
-
File Size-