Weird bug with native HTML and zk-if [closed]

asked 2018-09-11 16:19:04 +0800

digulla gravatar image digulla
506 5

updated 2018-09-12 10:58:39 +0800

cor3000 gravatar image cor3000
6280 2 7

I'm trying to omit a table row when a boolean condition is false:

  <zk if="${vm.visible}">
        <label value="Should be visible, too" />

When visible is true, the following HTML is rendered:

  <tr>   </tr>

Why is that?

ZK Fiddle: http://zkfiddle.org/sample/3ikg0ch/3-Weird-bug-with-native-HTML-and-zk-if

delete flag offensive retag edit

The question has been closed for the following reason "the question is answered, right answer was accepted" by cor3000
close date 2018-09-18 14:57:22


Additional tags which I can't create: native-html, conditional-rendering

digulla ( 2018-09-11 16:20:03 +0800 )edit

1 Answer

Sort by » oldest newest most voted

answered 2018-09-12 11:10:46 +0800

cor3000 gravatar image cor3000
6280 2 7

updated 2018-09-18 14:56:55 +0800

Weird indeed and I don't have an explanation why this happens right now ... looks/feels like a zul parser bug. (native elements are handled a bit special since multiple native elements can compact into a single widget in the server response) e.g.: ['zk.Native','i5LQa',{prolog:'<tr> <td> ',epilog:' <\/td> <\/tr>'},{},[ ... children ...]

I'll post a bug shortly.

As a workaround you can add the condition directly to the node you want to show/hide without the <zk> element:

<n:tr if="${vm.visible}">
    <label value="Should be visible, too" />

Your updated example using the workaround: http://zkfiddle.org/sample/3ikg0ch/6-Weird-bug-with-native-HTML-and-zk-if-workaround

UPDATE: I posted ZK-4055 with the above and an alternative workaround

version 8.6.0.FL.20180917 contains a fix which will be also included in 8.6.0

link publish delete flag offensive edit


Question tools

1 follower



Asked: 2018-09-11 16:19:04 +0800

Seen: 15 times

Last updated: Sep 18 '18

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More