From Documentation

Jump to: navigation, search

To mix with another markup language, you have to use xmlns to specify the correct namespace.

 <window xmlns:h="">

For the XHTML components, the onClick and onChange attributes are conflicts with ZK's attributes. To resolve, you have to use the reserved namespace,, as follows.

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

In this example, the onClick attribute is a ZHTML's attribute to specify JavaScript codes to run at the browser. On the other hand, the zk:onClick is a reserved attribute for specify a ZK event handler.

Notice that the namespace prefix, zk, is optional for the zscript element, because ZHTML has no such element and ZK has enough information to determine it.

Also notice that you have to specify the XML namespace for the window component, because it is from a different component set.

Auto-completion with Schema

Many IDEs, such Eclipse, supports auto-completion if XML schema is specified as follows.

 <window xmlns=""

In addition to downloading from, you can find zul.xsd under the dist/xsd directory in the ZK binary distribution.

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