ZK"

From Documentation
(Created page with '{{ZUMLReferencePageHeader}} Name: zk Namespace: http://www.zkoss.org/2005/zk Namespace shortcut: zk It is the reserved namespace for specifying ZK specific elements and attr…')
 
m (correct highlight (via JWB))
 
(3 intermediate revisions by 2 users not shown)
Line 4: Line 4:
 
  Namespace: http://www.zkoss.org/2005/zk
 
  Namespace: http://www.zkoss.org/2005/zk
 
  Namespace shortcut: zk
 
  Namespace shortcut: zk
 +
Java: <javadoc method="ZK_NAMESPACE">org.zkoss.zk.ui.metainfo.LanguageDefinition</javadoc>
  
It is the reserved namespace for specifying ZK specific elements and attributes, such as the zk element and the unless attribute.
+
It is the standard namespace for specifying ZK specific elements and attributes, such as the [[ZUML Reference/ZUML/Elements/zk|zk element]] and [[ZUML Reference/ZUML/Attributes/unless|unless attribute]].
 +
 
 +
By default, ZK Loader will detect if a XML element or attribute is a special element or attribute, and then handle it differently. However, if the default XML namespace is the [[ZUML Reference/ZUML/Namespaces/Native|native namespace]] or a component set that accepts any element name, such as [[ZUML Reference/ZUML/Languages/XHTML|the XHTML langauge]], you have to specify the zk namespace. Otherwise, they will be interpreted as a component. For example,
 +
 
 +
<source lang="xml" highlight="1">
 +
<html xmlns="native" xmlns:u="zul" xmlns:zk="zk">
 +
<head>
 +
<title>ZHTML Demo</title>
 +
</head>
 +
<body>
 +
<script type="text/javascript">
 +
function woo() { //running at the browser
 +
}
 +
</script>
 +
<zk:zscript>
 +
void addItem() { //running at the server
 +
}
 +
</zk:zscript>
 +
<u:window title="HTML App">
 +
<input type="button" value="Add Item"
 +
onClick="woo()" zk:onClick="addItem()"/>
 +
</u:window>
 +
</body>
 +
</html>
 +
</source>
  
 
=Version History=
 
=Version History=
Last Update : {{REVISIONYEAR}}/{{REVISIONMONTH}}/{{REVISIONDAY}}
+
{{LastUpdated}}
 
{| border='1px' | width="100%"
 
{| border='1px' | width="100%"
 
! Version !! Date !! Content
 
! Version !! Date !! Content

Latest revision as of 09:10, 17 January 2022

Name: zk
Namespace: http://www.zkoss.org/2005/zk
Namespace shortcut: zk
Java: LanguageDefinition.ZK_NAMESPACE

It is the standard namespace for specifying ZK specific elements and attributes, such as the zk element and unless attribute.

By default, ZK Loader will detect if a XML element or attribute is a special element or attribute, and then handle it differently. However, if the default XML namespace is the native namespace or a component set that accepts any element name, such as the XHTML langauge, you have to specify the zk namespace. Otherwise, they will be interpreted as a component. For example,

<html xmlns="native" xmlns:u="zul" xmlns:zk="zk">
	<head>
		<title>ZHTML Demo</title>
	</head>
	<body>
		<script type="text/javascript">
		function woo() { //running at the browser
		}
		</script>
		<zk:zscript>
		void addItem() { //running at the server
		}
		</zk:zscript>
		<u:window title="HTML App">
			<input type="button" value="Add Item"
			onClick="woo()" zk:onClick="addItem()"/>
		</u:window>
	</body>
</html>

Version History

Last Update : 2022/01/17


Version Date Content
     



Last Update : 2022/01/17

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