Skip to main content

Digital Transformation

Fun with Ajax (the ZKoss Framework)

A colleague recently turned me on to the ZKoss (ZK) Framework (http://www.zkoss.org/), and I have to say that I’m pretty pleased with it so far. 

It’s relatively simple to start up and get working, and it has a nice, rapid development model.   It has some of the feel of jsps but gives you a lot of RIA functionality with very little effort.   Essentially, you just use the pre-built tags and auto-magically excellent-looking UI results.  There’s no pre-compilation required.  You just drop in your .zul files (by default the .zul extension is mapped to the “zkLoader” servlet) to your webapp and they immediately run.   This makes incremental changes during development very easy.

I found the documentation adequate, but, as with any OSS project, more detail would be helpful.  I couldn’t, for instance, figure out how to change the colors of lines in a chart.

It’s pretty easy to set up and requires no more than a Tomcat server to run.  You simply drop in some libraries, and configure your web.xml file and you’re ready to go.

I recently investigated it for a client to determine whether it was possible to generate charts out of Excel spreadsheets.  At first, my hopes were really high, as I misunderstood the documentation (based on a picture) to mean that existing Excel charts could be extracted from the spreadsheets themselves.  Instead, after more investigation, I discovered that it was easy to retrieve tabular information using the ZK tags, encapsulate it in an object, and then pass it to the chart object (created in a “chart” tag).  This resulted in a very nice Excel-like chart.

One of the nice things about this approach is that it is conceivable to be able to templatize the .zul file in such a way that more advanced business users could create their own charts and deploy them through a content management system.  This is possible because of the lack of pre-compilation.

In an upcoming post, I’ll describe in detail how I created a line chart from an Excel spreadsheet, and I’m sure I’ll be exploring the ZK framework more in the future.  I’d encourage others to give it a shot as well.

Thoughts on “Fun with Ajax (the ZKoss Framework)”

  1. Thanks for the submission. It’s nice to review the different JS frameworks on the market.

    We’ve implemented a solution using Ext JS which has a similar look and feel to ZKoss. Based on a quick glance at the underlying code in the provided examples, it appears that developers have to include custom support for browsers such as IE 6. Did you happen to find this a hindrance in your implementation?

    I am also curious to learn the reason that your client chose not to use the provided DOJO library. Our client wasn’t satisfied by the over all look and feel of DOJO.

  2. Markus Muetschard

    ZK is indeed very impressive. Having done extensive JS for more than a decade, AJAX the basic way when the HTTPRequest object became available, then dojo / dijit, and most recently GWT, I like the IDE integration into Eclipse and the direct, WISIWIG approach of ZK. On the other hand, with increasing use of meta data to dynamically create the UI, the direct approach looses its appeal. I can easily see ZK in plain (island) Web application environments succeeding, but to integrate and provide advantages portal composite application technology there is still some legwork to be done. This leads to a general thought: framework over framework, application architecture over application architecture adds complexity, and with ZK’s ‘attitude’ of creating a complete new way of doing things hides the complexity of the basic technologies in use but creates a new learning curve, and last but not least, when it will come into the releases and integration into other environments, upward compatibility and migration nightmares will start to kick in as it already does with, for example, dojo and WebSphere Portal – especially since the html document and browser support only single document interface… it is time that an MDI type browser would come on the market and provide name or what ever spaces with interoperability support between (widget/portlet) components built of different versions of the same framework. May be I’m for too long into this business where the wheel is not even reinvented, but refashioned more and more frequently. Don’t want to be a party pooper, though, and say: there IS progress in IS/IT.

  3. Hi John,

    Thanks for your compliment.
    About color customization of chart, you have extends JFreeChartEngine and override prepareJFreeChart(JFreeChart jfchart, Chart chart). Or you can refer to
    http://zkoss.org/forum/index.zul#path%3DlistComment%3BdiscussionId%3D8022%3BcategoryId%3D14%3B

    By the way, did you give ZK Spreadsheet a try, it’s a mega component compliant with Excel. http://zkoss.org/product/zkspreadsheet.dsp

    Last, if you have any issue please feel free to contact me.

    /robbiecheng

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

John Bimson

With 8+ years of portal development, implementation, architecture, and strategy experience, John has amassed a wealth and variety of knowledge of the portal space. Having spent five years in the WebLogic Portal group at BEA, John has been on both sides of "the wall" dividing portal vendors from implementers. This knowledge of software products' inner workings gives him a unique perspective as he strives to get the best out of technologies applied to business problems. Since joining Perficient, John has been involved with several full-scale portal implementations, focusing on content integration and security. Now, in the National Portal Practice John works to guide clients' strategic portal direction, create new Perficient offerings, and keep apprised of the latest portal and web trends.

More from this Author

Follow Us
TwitterLinkedinFacebookYoutubeInstagram