ZK User Interface Markup Language"

From Documentation
m (correct highlight (via JWB))
 
(20 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
{{ZKDevelopersGuidePageHeader}}
 
{{ZKDevelopersGuidePageHeader}}
  
==[[ZUML_Overview|Overview]]==
+
{{Old Version
*[http://books.zkoss.org/wiki/ZK_Developer%27s_Guide/Fundamental_ZK/ZK_User_Interface_Markup_Language/Overview Overview]
+
|url=http://books.zkoss.org/wiki/ZK_Developer%27s_Reference/UI_Composing/ZUML
 +
|}}
  
==[http://books.zkoss.org/wiki/ZK_Developer%27s_Guide/Fundamental_ZK/ZK_User_Interface_Markup_Language/XML_Format XML]==
+
==Overview==
*[http://books.zkoss.org/wiki/ZK_Developer%27s_Guide/Fundamental_ZK/ZK_User_Interface_Markup_Language/XML/Elements_Must_Be_Well-formed Elements Must Be Well-formed]
 
*[http://books.zkoss.org/wiki/ZK_Developer%27s_Guide/Fundamental_ZK/ZK_User_Interface_Markup_Language/XML/Special_Character_Must_Be_Replaced Special Character Must Be Replaced]
 
*[http://books.zkoss.org/wiki/ZK_Developer%27s_Guide/Fundamental_ZK/ZK_User_Interface_Markup_Language/XML/Attribute_Values_Must_Be_Specified_and_Quoted Attribute Values Must Be Specified and Quoted]
 
*[http://books.zkoss.org/wiki/ZK_Developer%27s_Guide/Fundamental_ZK/ZK_User_Interface_Markup_Language/XML/Comments Comment by <nowiki><-- --></nowiki>]
 
*[http://books.zkoss.org/wiki/ZK_Developer%27s_Guide/Fundamental_ZK/ZK_User_Interface_Markup_Language/XML/Character_Encoding Character Encoding]
 
  
==[[zscript]]==
+
The ZK User Interface Markup Language (ZUML) is based on XML. ZUML file has filename extension : zul. Each ZK element instructs the ZK Loader which component to create. A ZK property describes an initial value to be assigned to the created component. A ZK processing instruction describes how to process the whole page, such as the page title.
*[[Zscript#Write_Java_code_in_ZUML | Write Java code in ZUML]]
 
*[[Zscript#Hints_to_read_zscript | Hints to read zscript ]]
 
*[[Zscript#Distinguish_zscript_from_EL | Distinguish zscript from EL ]]
 
*[[Zscript#Java_Interpreter_.28BeanShell.29 | Java Interpreter (BeanShell) ]]
 
*[[Zscript#zscript_other_than_Java | zscript other than Java ]]
 
  
==[[ZUML_Implicit Objects|Implicit Objects]]==
+
[[ZK Developer's Guide/Fundamental ZK/ZK User Interface Markup Language/Implicit Objects/List of Implicit Objects|Implicit Objects]] are much like global variables handled by system. You can use it to get information of system and client. Also, it's a way to pass information between pages. You'll find it really helpful in developing a web application.
*[[ZUML_Implicit Objects#Overview|Overview]]
 
*[[ZUML_Implicit Objects#List_of_Implicit_Objects|List of Implicit Objects]]
 
*[[ZUML_Implicit Objects#Information_about_Request_and_Execution|Information about Request and Execution]]
 
*[[ZUML_Implicit Objects#Lifecycle_of_page.2C_request.2C_session.2C_application|Lifecycle of page, execution, desktop, session, application]]
 
*[[ZUML_Implicit Objects#About_xxxScope|About xxxScope]]
 
  
==[[ZUML_Expression Language (EL)|Expression Language (EL)]]==
+
'''Expresion Language''' let you access variables in intuitive way.
*[[ZUML_Expression Language (EL)#Overview|Overview]]
 
*[[ZUML_Expression Language (EL)#Access_Java_Bean|Access Java Bean]]
 
*[[ZUML_Expression Language (EL)#Access_ZUML_Component|Access ZUML Component]]
 
*[[ZUML_Expression Language (EL)#Access_Implicit_Object|Access Implicit Object]]
 
*[[ZUML_Expression Language (EL)#More_EL_Examples|More EL Examples]]
 
*[[ZUML_Expression Language (EL)#Import_Java_Method's|Import Java Method's]]
 
  
==[[ZUML_ZK Processing Instructions|ZK Processing Instructions]]==
+
'''zscript''' let you write java code inside ZUML, for fast prototyping.
  
Directives to control whole page behavior
+
In section '''ZK Processing Instruction''', we'll show how to use the most common directives to control page behavior, such like macro component.
  
{| border="1"
+
In section '''ZK Attributes''', we'll show attributes used to control the associated element, not just initializing the data member. It provides utilities like conditional evaluation(<code>if</code>), iterative evaluation(<code>forEach</code>), etc.
! <center>Processing Instruction Name</center>
 
! <center>Description</center>
 
|-
 
|  [[ZUML_ZK Processing Instructions#The_page_Directive|<tt>page</tt>]]
 
| Describes attributes of a page
 
|-
 
|  [[ZUML_ZK Processing Instructions#The_component_Directive|<tt>component</tt>]]
 
| Defines a new component for a particular page
 
|}
 
  
==[[ZUML_ZK Attributes|ZK Attributes]]==
+
In section '''ZK Elements''', we'll show useful elements that's not UI component, like <code>zk</code> element, <code>zscript</code> element.
  
Act on component, such like conditional evaluation, iteration, load on demand.
+
After reading this chapter, you should be able to write your own ZUML pages easily.
  
{| border="1"
 
! <center>Attribute Name</center>
 
! <center>Description</center>
 
|-
 
| [[ZUML_ZK Attributes#The_if_Attribute|<tt>if</tt>]]
 
| Conditional evaluation of an component
 
|-
 
| [[ZUML_ZK Attributes#The_forEach.2C_each.2C_forEachBegin.2C_forEachEnd_Attribute|<tt>forEach</tt>, <tt>each</tt>]]
 
| Iterative evaluate component against a collection
 
|-
 
| [[ZUML_ZK_Attributes#The_use.2C_apply_Attribute|<tt>use</tt>, <tt>apply</tt>]]
 
  
| Write event handling code in pure java file. <tt>apply</tt> support MVC pattern better.
+
{{ZKDevelopersGuideHeadingToc}}
|-
 
| [[ZUML_ZK_Attributes#The_forward_Attribute|<tt>forward</tt>]]
 
  
| Let centralized controller handle events.
 
|}
 
 
==[[ZUML_ZK Elements|ZK Elements]]==
 
 
Helper component that's not UI. It helps to save variable, write java code in ZUML, and others.
 
 
{| border="1"
 
! <center>Element Name</center>
 
! <center>Description</center>
 
|-
 
|  [[ZUML_ZK Elements#The_zk_Element|<tt>zk</tt>]]
 
| Aggregate other components
 
|-
 
| [[ZUML_ZK Elements#The_zscript_Element|<tt>zscript</tt>]]
 
| Write java code in ZUML
 
|-
 
| [[ZUML_ZK Elements#The_attribute_Element|<tt>attribute</tt>]]
 
| Make the page more readable
 
|-
 
|  [[ZUML_ZK Elements#The_variables_element|<tt>variables</tt>]]
 
| Store variable in namespace scope
 
|-
 
| [[ZUML_ZK Elements#The_custom-attributes_element|<tt>custom-attributes</tt>]]
 
| Store variables in different scopes
 
|}
 
 
==[[ZUML_Component Sets and XML Namespaces|Component Sets and XML Namespaces]]==
 
*[[ZUML_Component Sets and XML Namespaces#Overview|Overview]]
 
*[[ZUML_Component Sets and XML Namespaces#Standard_Namespaces|Standard Namespaces]]
 
*[[ZUML_Component Sets and XML Namespaces#Mix_With_Another_Markup_Language|Mix With Another Markup Language]]
 
  
 
{{ ZKDevelopersGuidePageFooter}}
 
{{ ZKDevelopersGuidePageFooter}}

Latest revision as of 10:36, 19 January 2022

DocumentationZK Developer's GuideFundamental ZKZK User Interface Markup Language
ZK User Interface Markup Language


Stop.png This documentation is for an older version of ZK. For the latest one, please click here.


Stop.png This documentation is for an older version of ZK. For the latest one, please click here.

Overview

The ZK User Interface Markup Language (ZUML) is based on XML. ZUML file has filename extension : zul. Each ZK element instructs the ZK Loader which component to create. A ZK property describes an initial value to be assigned to the created component. A ZK processing instruction describes how to process the whole page, such as the page title.

Implicit Objects are much like global variables handled by system. You can use it to get information of system and client. Also, it's a way to pass information between pages. You'll find it really helpful in developing a web application.

Expresion Language let you access variables in intuitive way.

zscript let you write java code inside ZUML, for fast prototyping.

In section ZK Processing Instruction, we'll show how to use the most common directives to control page behavior, such like macro component.

In section ZK Attributes, we'll show attributes used to control the associated element, not just initializing the data member. It provides utilities like conditional evaluation(if), iterative evaluation(forEach), etc.

In section ZK Elements, we'll show useful elements that's not UI component, like zk element, zscript element.

After reading this chapter, you should be able to write your own ZUML pages easily.





Last Update : 2022/01/19

Copyright © Potix Corporation. This article is licensed under GNU Free Documentation License.