ZK User Interface Markup Language"

From Documentation
m (correct highlight (via JWB))
 
(8 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
{{ZKDevelopersGuidePageHeader}}
 
{{ZKDevelopersGuidePageHeader}}
 +
 +
{{Old Version
 +
|url=http://books.zkoss.org/wiki/ZK_Developer%27s_Reference/UI_Composing/ZUML
 +
|}}
  
 
==Overview==
 
==Overview==
Line 5: Line 9:
 
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.
 
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.
  
[[ZUML 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.
+
[[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.
  
 
'''Expresion Language''' let you access variables in intuitive way.
 
'''Expresion Language''' let you access variables in intuitive way.
Line 13: Line 17:
 
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 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(<tt>if</tt>), iterative evaluation(<tt>forEach</tt>), etc.
+
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.
  
In section '''ZK Elements''', we'll show useful elements that's not UI component, like <tt>zk</tt> element, <tt>zscript</tt> element.
+
In section '''ZK Elements''', we'll show useful elements that's not UI component, like <code>zk</code> element, <code>zscript</code> element.
  
 
After reading this chapter, you should be able to write your own ZUML pages easily.
 
After reading this chapter, you should be able to write your own ZUML pages easily.
  
* See Also
 
** [[iZUML]]
 
 
==[http://books.zkoss.org/wiki/ZK_Developer%27s_Guide/Fundamental_ZK/ZK_User_Interface_Markup_Language/XML_Format XML]==
 
*[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]
 
 
==[http://books.zkoss.org/wiki/ZK_Developer%27s_Guide/Fundamental_ZK/ZK_User_Interface_Markup_Language/zscript zscript]==
 
*[http://books.zkoss.org/wiki/ZK_Developer%27s_Guide/Fundamental_ZK/ZK_User_Interface_Markup_Language/zscript/Write_Java_code_in_ZUML Write Java code in ZUML]
 
*[http://books.zkoss.org/wiki/ZK_Developer%27s_Guide/Fundamental_ZK/ZK_User_Interface_Markup_Language/zscript/Hints_to_read_zscript Hints to read zscript ]
 
*[http://books.zkoss.org/wiki/ZK_Developer%27s_Guide/Fundamental_ZK/ZK_User_Interface_Markup_Language/zscript//Distinguish_zscript_from_EL Distinguish zscript from EL ]
 
*[http://books.zkoss.org/wiki/ZK_Developer%27s_Guide/Fundamental_ZK/ZK_User_Interface_Markup_Language/zscript/Java_Interpreter_.28BeanShell.29 Java Interpreter (BeanShell) ]
 
*[http://books.zkoss.org/wiki/ZK_Developer%27s_Guide/Fundamental_ZK/ZK_User_Interface_Markup_Language/zscript/zscript_other_than_Java  zscript other than Java ]
 
 
==[http://books.zkoss.org/wiki/ZK_Developer%27s_Guide/Fundamental_ZK/ZK_User_Interface_Markup_Language/Implicit_Objects Implicit Objects]==
 
*[http://books.zkoss.org/wiki/ZK_Developer%27s_Guide/Fundamental_ZK/ZK_User_Interface_Markup_Language/Implicit_Objects#Overview Overview]
 
*[http://books.zkoss.org/wiki/ZK_Developer%27s_Guide/Fundamental_ZK/ZK_User_Interface_Markup_Language/Implicit_Objects#List_of_Implicit_Objects List of Implicit Objects]
 
*[http://books.zkoss.org/wiki/ZK_Developer%27s_Guide/Fundamental_ZK/ZK_User_Interface_Markup_Language/Implicit_Objects#Information_about_Request_and_Execution Information about Request and Execution]
 
*[http://books.zkoss.org/wiki/ZK_Developer%27s_Guide/Fundamental_ZK/ZK_User_Interface_Markup_Language/Implicit_Objects#Life_cycle_of_page.2C_execution.2C_desktop.2C_session.2C_application Lifecycle of page, execution, desktop, session, application]
 
*[http://books.zkoss.org/wiki/ZK_Developer%27s_Guide/Fundamental_ZK/ZK_User_Interface_Markup_Language/Implicit_Objects#About_xxxScope About xxxScope]
 
 
==[http://books.zkoss.org/wiki/ZK_Developer%27s_Guide/Fundamental_ZK/ZK_User_Interface_Markup_Language/Expression_Language_%28EL%29 Expression Language (EL)]==
 
*[http://books.zkoss.org/wiki/ZK_Developer%27s_Guide/Fundamental_ZK/ZK_User_Interface_Markup_Language/Expression_Language_%28EL%29#Overview Overview]
 
*[http://books.zkoss.org/wiki/ZK_Developer%27s_Guide/Fundamental_ZK/ZK_User_Interface_Markup_Language/Expression_Language_%28EL%29#Access_Java_Bean Access Java Bean]
 
*[http://books.zkoss.org/wiki/ZK_Developer%27s_Guide/Fundamental_ZK/ZK_User_Interface_Markup_Language/Expression_Language_%28EL%29#Access_ZUML_Component Access ZUML Component]
 
*[http://books.zkoss.org/wiki/ZK_Developer%27s_Guide/Fundamental_ZK/ZK_User_Interface_Markup_Language/Expression_Language_%28EL%29#Access_Implicit_Object Access Implicit Object]
 
*[http://books.zkoss.org/wiki/ZK_Developer%27s_Guide/Fundamental_ZK/ZK_User_Interface_Markup_Language/Expression_Language_%28EL%29#More_EL_Examples More EL Examples]
 
*[http://books.zkoss.org/wiki/ZK_Developer%27s_Guide/Fundamental_ZK/ZK_User_Interface_Markup_Language/Expression_Language_%28EL%29#Import_Java_Methods Import Java Method's]
 
 
==[http://books.zkoss.org/wiki/ZK_Developer%27s_Guide/Fundamental_ZK/ZK_User_Interface_Markup_Language/ZK_Processing_Instructions ZK Processing Instructions]==
 
 
Directives to control whole page behavior
 
 
{| border="1"
 
! <center>Processing Instruction Name</center>
 
! <center>Description</center>
 
|-
 
|  [http://books.zkoss.org/wiki/ZK_Developer%27s_Guide/Fundamental_ZK/ZK_User_Interface_Markup_Language/ZK_Processing_Instructions#The_page_Directive <tt>page</tt>]
 
| Describes attributes of a page
 
|-
 
|  [http://books.zkoss.org/wiki/ZK_Developer%27s_Guide/Fundamental_ZK/ZK_User_Interface_Markup_Language/ZK_Processing_Instructions#The_component_Directive <tt>component</tt>]
 
| Defines a new component for a particular page
 
|}
 
 
==[[ZUML_ZK Attributes|ZK Attributes]]==
 
 
Act on component, such like conditional evaluation, iteration, load on demand.
 
 
{| 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.
 
|-
 
| [[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"
+
{{ZKDevelopersGuideHeadingToc}}
! <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.