ZKTM Small Talks

ZK Sample Application

Simply Rich

Home / Small Talks

Michael Lee
Principal Systems Analyst
The Kowloon Motor Bus Co. (1933) Limited
May 29, 2006

Purpose

ZK is a powerful Ajax framework which let developer create "Rich" web application without using any Javascript, just Java. Although a very attractive Live Demo available, new comer (like me) still wonder how to get started with an application. This article try to show you how an application can be easily build and some of the possibilities with ZK. (Due to my limited experience with the framework - less than 3 months, it is not the best approach).

Approach

I ported the first Java Web Application I encountered (2-3 years ago) to ZK, it is the example application that come with Struts. During this process, all business objects of Struts-Example has been reused without amendment. This is a very simple example, however it can demonstrate how to implement screen flow, how to perform data validation and how to access business logic layer. Also, in this sample, I have used the Live Data listbox with a custom ListitemRenderer to display multiple columns, implement a custom event, passing parameter on window creation and other skills required to create a real-life application.

Screenshots

Following is the screenshots for original and transformed application.

Screenshots of Strut Sample Application

struts-1 strust-2 struts-3
struts-4 strust-5 struts-6
Click to zoom the images

Screenshots of ZK Sample Application

sample-1 sample-2 sample-3
sample-4 sample-5 sample-6
Click to zoom the images

Steps

To port the application, follows steps performed:

Installation

To run ZK, you need a Web Container which support Servlet 2.4. If you have ZK installed, just deploy the zk-sample.war to the Container. For Tomcat, it means copy it to webapps. To install the sample application bundled with ZK (1.2.0 RC3), use zk-sample-full.war.

Downloads

Todo

Michael Lee is a Principal Systems Analyst working for The Kowloon Motor Bus Co. (1933) Limited (Hong Kong). His major responsibility is on application design and implementation on client/server architecture using Powerbuilder. Experience on Java and Web development is limited.

Copyright © Michael Lee. This article is licensed under GNU General Public License.
SourceForge.net Logo