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

digulla
502 4

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

  <zk if="${vm.visible}"> <n:tr> <n:td> <label value="Should be visible, too" /> </n:td> </n:tr> </zk>  When visible is true, the following HTML is rendered:  <tr> </tr>  Why is that? delete 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 ## Comments Additional tags which I can't create: native-html, conditional-rendering ( 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 4466 2 7 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}">
<n:td>
<label value="Should be visible, too" />
</n:td>
</n:tr>


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