没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
SIMPLY RICH
ZK
TM
The Developer's Guide
Version 2.4.1
July 2007
Potix Corporation
Revision 165
ZK: Developer's Guide Page 1 of 231 Potix Corporation
p
p
o
o
t
t
i
i
x
x
p
p
o
o
t
t
i
i
x
x
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 231 Potix Corporation
Table of Contents
1. Introduction...............................................................................................................16
Traditional Web Applications.......................................................................................... 16
Ad-hoc AJAX Applications.............................................................................................. 16
ZK: What It Is ............................................................................................................ 17
ZK: What It Is Not....................................................................................................... 18
ZK: Limitations............................................................................................................ 19
2. Getting Started.......................................................................................................... 20
Hello World!................................................................................................................ 20
Interactivity................................................................................................................ 20
The zscript Element...................................................................................................... 21
The Scripting Language............................................................................................ 22
The Scripting Codes in a Separate File........................................................................ 22
The attribute Element................................................................................................... 22
The EL Expressions...................................................................................................... 23
The id Attribute........................................................................................................... 24
The if and unless Attributes........................................................................................... 24
The forEach Attribute................................................................................................... 24
The use Attribute......................................................................................................... 25
Implement Java Classes in zscript.............................................................................. 26
Create Components Manually........................................................................................ 26
Developing ZK Applications without ZUML................................................................... 27
Define New Components for a Particular Page.................................................................. 28
3. The Basics..................................................................................................................29
Architecture Overview.................................................................................................. 29
The Execution Flow.................................................................................................. 30
Components, Pages and Desktops.................................................................................. 30
Components............................................................................................................ 30
Pages..................................................................................................................... 30
Page Title........................................................................................................... 31
Desktops................................................................................................................ 31
The createComponents Method.............................................................................. 31
Forest of Trees of Components................................................................................... 31
ZK: Developer's Guide Page 3 of 231 Potix Corporation
Component: a Visual Representation and a Java Object................................................. 32
Identifiers............................................................................................................... 32
UUID...................................................................................................................... 32
The ID Space.............................................................................................................. 33
Namespace and ID Space.......................................................................................... 34
Variable and Functions Defined in zscript..................................................................... 34
zscript and EL Expressions..................................................................................... 35
Multi-Scope Interpreters....................................................................................... 36
Single-Scope Interpreters...................................................................................... 37
Multiple scripting Languages in One Page................................................................ 38
getVariable versus getZScriptVariable..................................................................... 38
Events........................................................................................................................ 38
Desktops and Event Processing...................................................................................... 39
Desktops and the Creation of Components................................................................... 39
ZUML and XML Namespaces.......................................................................................... 39
4. The Component Lifecycle........................................................................................... 41
The Lifecycle of Loading Pages....................................................................................... 41
The Page Initial Phase.............................................................................................. 41
The Component Creation Phase.................................................................................. 41
The Event Processing Phase....................................................................................... 42
The Rendering Phase................................................................................................ 42
The Lifecycle of Updating Pages..................................................................................... 42
The Request Processing Phase................................................................................... 42
The Event Processing Phase....................................................................................... 43
The Rendering Phase................................................................................................ 43
The Molds................................................................................................................... 43
Component Garbage Collection...................................................................................... 44
5. Event Listening and Processing..................................................................................45
Add Event Listeners by Markup Languages...................................................................... 45
Add and Remove Event Listeners by Program................................................................... 45
Declare a Member.................................................................................................... 45
Add and Remove Event Listeners Dynamically.............................................................. 46
Deferrable Event Listeners......................................................................................... 46
Add and Remove Event Listeners to Pages Dynamically................................................. 47
The Invocation Sequence.......................................................................................... 48
Abort the Invocation Sequence.................................................................................. 48
ZK: Developer's Guide Page 4 of 231 Potix Corporation
Send and Post Events from an Event Listener................................................................... 48
Post Events............................................................................................................. 48
Send Events............................................................................................................ 49
Thread Model.............................................................................................................. 49
Suspend and Resume............................................................................................... 49
Long Operations...................................................................................................... 50
Example: A Working Thread Generates Labels Asynchronously................................... 51
Alternative 1: Timer (No Suspend/Resume)............................................................. 52
Alternative 2: Piggyback (No Suspend/Resume, No Timer)......................................... 53
Initialization and Cleanup of Event Processing Thread....................................................... 54
Initialization Before Processing Each Event.................................................................. 54
Cleanup After Processed Each Event........................................................................... 55
6. The ZK User Interface Markup Language....................................................................56
XML........................................................................................................................... 56
Elements Must Be Well-formed.................................................................................. 56
Special Character Must Be Replaced........................................................................... 57
Attribute Values Must Be Specified and Quoted............................................................ 57
Comments.............................................................................................................. 57
Character Encoding.................................................................................................. 57
Namespace............................................................................................................. 58
Auto-completion with Schema................................................................................ 59
Conditional Evaluation.................................................................................................. 59
Iterative Evaluation...................................................................................................... 59
The each Variable.................................................................................................... 60
The forEachStatus Variable........................................................................................ 60
How to Use each and forEachStatus Variables in Event Listeners..................................... 61
A Solution: custom-attributes................................................................................ 61
Load on Demand......................................................................................................... 62
Load-on-Demand with the fulfill Attribute.................................................................... 62
Load-on-Demand with an Event Listener..................................................................... 63
Implicit Objects........................................................................................................... 63
List of Implicit Objects.............................................................................................. 63
Information about Request and Execution.................................................................... 65
Processing Instructions................................................................................................. 65
The page Directive................................................................................................... 65
The component Directive........................................................................................... 67
The by-macro Format........................................................................................... 67
ZK: Developer's Guide Page 5 of 231 Potix Corporation
剩余230页未读,继续阅读
资源评论
游戏泥瓦匠
- 粉丝: 109
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功