Subscribe

  • Subscribe  

Java + MXML + AJAX = ZK, Sun Should have Done This

Posted by Charles | November 11, 2008 .

If you haven’t done this, it’s time now go check out ZK, a open source AJAX RIA development environment/tool/framework, which is Java driven and claims to be Direct RIA solution. Flex developers, be aware.

The smart people behind ZK seem to me have done everything right. Here are the reasons I come to think of:

  • It leverages Java at server side as runtime environment. The result is a huge developer base is ready to jump in.
  • It doesn’t reinvent any wheel, in stead you will build the UI just like using Flex’s MXML (like what Microsoft has done to Silverlight). The result is a proven way of constructing UI and nobody can dispute or dislike it. Did you hear that, Sun? What the hack is the ugly JavaFX Script?
  • The end UI is AJAX. The result is instant browser neutral solution and everybody with a modern browser is happy. No client tech religion war.
  • It’s mobile ready. The result is future platform ready. A great selling point.
  • If don’t like MXML alike ZK XML tags, you can do ZK in Ruby, Java or JSP. The result is, again, everybody is happy and no language war.

All the above is everything Sun should have done when introduced the wana-be-flash-killer JavaFX. I would say Sun should use the money saved from laying off 350 people this week to acquire ZK and start over again. BTW, dump JavaFX too.

Anyway, using ZK to create a UI like this:

input Java + MXML + AJAX = ZK, Sun Should have Done This

The code would be like this:

<window title="To do list" width="640px" border="normal">

<listbox id="box" multiple="true"  rows="4">

  <listhead>

   <listheader label="Item" />

   <listheader label="Priority" width="50px" />

   <listheader label="Opened" width="90px" />

  </listhead>

  <listitem>

   <listcell/>

   <listcell/>

   <listcell/>

  </listitem>

 </listbox>

  <listcell/>

  Item:<textbox id="name" cols="50" />

    Priority:<intbox id="priority" cols="1" />

    Date:<datebox id="date" cols="8"/>

    <button label="Add" width="36px" height="24px"/>

    <button label="Update" width="46px" height="24px"/>

    <button label="Delete" width="46px" height="24px"/>

</window>

Very comfortable and familiar piece of code, isn’t it?

Leave a Comment

If you would like to make a comment, please fill out the form below.


Name

Email

Website

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Comments

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word


Related Posts

24 Comments so far
  1. robbiecheng  November 11, 2008 5:34 pm

    Nice article, I’ve forwarded your article to Dzone.
    http://www.dzone.com/links/java_mxml_ajax_zk_sun_should_have_done_this.html

  2. Martin B.  November 11, 2008 6:03 pm

    I think you are missing the point of what JavaFX is actually capable of delivering. While the ZK looks nice, it is nothing exceptional and (sorry for that) produces rather mediocre UI experience. I think you will be (positively) surprised next month.

  3. Scott  November 11, 2008 6:25 pm

    I cannot agree more. Sun shall stop patching over-designed JSF with Ajax feature. Rather, they shall combine the power of XML, Java and dynamical languages, like Groovy — just like what ZK did.

  4. Anonymous  November 12, 2008 12:05 am

    You (and the whole ZK site for that matter) fail to mention that it’s GPL and I didn’t see any pricing info… This is where it stops for me.

    And I don’t see what JavaFX has to do with it.

  5. OtengiM  November 12, 2008 2:53 am

    Yeah the license is GPL but it doesnt bother for Web applications. If you are going to distributed your application in binary form and dont give the source that is the problem but if your app will be in a web sever and you own the server and your clients just access the website there is not a problem with GPL. Of course with this kick ass framework I would liked it was LGPL but still works. For big companies can pay the support or the commercial license.

    ZK framework is a great piece of software, SUN should stop of wasting time with JavaFX, Java devs doesnt want JavaFX even designers doesnt understand JavaFX. Sun should put more effort into Swing and a framework as ZK, That is pragmatic.

  6. Yuri  November 12, 2008 8:38 am

    OtengiM, have you done anything you can show in this ‘kick ass’ framework, or your ‘great’ appreciation for it is just as empty as your JavaFX bashing?

  7. Iantsai  November 12, 2008 6:54 pm

    ZK is more beautiful now.

    You can past the Demo code to : http://www.zkoss.org/zkdemo/userguide/

    And sorry to inform you there is a bug in line 14.

    There is a listcell below to the end tag of listbox, and it’s incorrect because listcell must be a child of listbox can’t directly be the child of window.

  8. Iantsai  November 12, 2008 7:58 pm

    OK, paste will be easy for who want to take a try.
    the correct code is:

    Item:
    Priority:
    Date:

  9. Iantsai  November 12, 2008 8:00 pm

    Ah, seems like this system will eat all tags in comment.

  10. nrapendra  November 12, 2008 10:38 pm

    hi Charles .. nice post :)
    I was wondering if there is any way to use FLEX and JAVA at client side only for a desktop application … in such a manner back-end is java based and front-end is Flex…

  11. Tim  November 14, 2008 11:48 am

    I think you may be overlooking OpenLaszlo, which can also render to Flash. What advantages does ZK have over OpenLaszlo?

  12. Anonymous  November 14, 2008 2:27 pm

    Hi Charles,

    pretty useless JavaFX bashing and ZK hype. I am not going to use it anyway and please you and all the ZK team try to use a less destructive marketing approach (ZK rocks, all the rest sucks).

    Although I like the framework, I prefer JSF or Flex mostly because of the commitment behind them.

  13. OtengiM  November 14, 2008 10:42 pm

    With just one paragraph of ZK code I can get a working form for client register without a problem. With JSF? Its hell and JavaFX I don’t know where to start, there is even not standard components yet. Lets face it, JavaFX is failed project already and Sun is loosing 6000 of good employees that sounds bad for JavaFX. I hope nothing happen to Java.

    Flex is proprietary, no thank you. I don’t want to pass to that hell again.

  14. OtengiM  November 14, 2008 10:44 pm

    By the way OpenLaszlo and Flex and JavaFX the users need a plugin, In some corporates environments are not allowed the plugins maybe there is more chance Ajax is allowed with the users. ZK is the way to go now.

  15. Edwin C.  November 17, 2008 1:34 am

    OtengiM,

    Even though I know little about OpenLazlo, you are misinformed if you think users need a plugin for it.

    OpenLazlo can compile to Ajax as well as Flash.

    I agree with previous posts that ZK seems to have very aggressive marketing, bashing other frameworks with wrong information.

    With respect to the UI experience. I saw checkboxes and listboxes that look afwully similar to Ext-JS checkboxes and listboxes. I almost get the idea that somebody got very inspired by looking at Ext-JS.

    It seems to me that it’s more worthwhile to spent time documenting and extending ZK, than spent effort trying to bash other technologies.

  16. Joonas Koivunen  November 17, 2008 7:19 am

    An interesting follow up would be making the back-end to this todo list of yours? Perhaps with some of that Hibernate/Spring integration they keep flashing in those ZK clips :)

    Very eye-opening indeed. Another product like this could be IT Mills Toolkit (http://www.itmill.com/)?

  17. dan  November 18, 2008 1:26 am

    Thats just another stupid proprietary framework :)

  18. quesera  May 12, 2009 3:25 am

    Yeah, I am exploring it too, can you post some of tutorial and links =) I am a newbie.

    Thanks a lot!

  19. litts  May 15, 2009 8:20 am

    this is Java oriented and i think openLaszlo beats it for me ofcourse coz i use another database language .. with laszlo i can stream a dataset xml and separate completely my UI with my Business Logic Layer and the Database .. I was disapointed when i failed to use ZK this way i give laszlo thump up ..

  20. jack  August 4, 2009 3:29 am

    @litts,

    I don’t know why you cann’t separate UI from data with ZK. There are a lot of articles talking about MVC (ZK+Spring+Hiberante). I have used ZK in more than half of dozen projects. They work great. It saves a lot of efforts by comparing some projects that use Dojo (and PHP). Dojo is too slow and heavy. However, I don’t have experiences with JavaFX and OpenLazslo, so I don’t have comments on that.

  21. Nicolás Dijkstra  August 7, 2009 7:54 am

    Grails + Groovy + ZK = (Easy + Fast) * RIA_Development !!

  22. Simon Massey  September 28, 2009 8:40 am

    @Joonas Koivunen a backend to that was written using spring and JPA here:

    http://ria.dzone.com/articles/using-desktop-model-view

  23. Simon Massey  September 28, 2009 8:43 am

    Just a note to say that the next major release of ZK will be LGPL. That means that there is no confusion that it is really free to use in any circumstances. That was always the case. The commercial license covers commercial support and some ‘pro’ features.

  24. subzero  February 15, 2011 9:13 pm

    Sucked bigtime then sucks now. Uses XUL. Customization is a pain. That is jus a part of the code.

<
Know How rund um Vergussmoertelsysteme direkt vom Spezialisten.
Native american payday loan direct lenders cash loan today
Direct TV Offers - usdirect has the best directtv deals