Search code examples
javahtmlzk

Why is zk rendering a second tbody for a listbox?


I'm having a problem where zk 3.6.3 is rendering a second <tbody> tag for a Listbox. Actually the first rendered <tbody> tag is the one that is making me problems. It has it's css style set to visibility:hidden;height:0px and Opera 12 and IE 11 are rendering a large white empty space for it. So in the browser I see the table header, this empty space and then the actual rows of the listbox.

The problematic code for zkoss rendering is contained in org.zkoss.zkmax.zul.render.ListboxDefault in lines 53-63.

How can I prevent zkoss or browsers from rendering this empty space?


Solution

  • Well, there is always a solution and maybe the "hacking" solution is the best here :

    Class overriding of that class.

    1. Create that package and create that class (exactly the same package and classname).
    2. Copy the code from your link to your class.
    3. Change the code, I'll suggest try to remove the complete if. => See what result it gives (test al your listboxes!)
    4. When you ever think of upgrading ZK version : Don't forget to remove or update the class !!!

    If removing doesn't help, try to change the style,...

    On the other hand, if updating ZK version is possible, you should try that.
    The version you use is old, and doesn't support newer browsers.