also on stackoverflow: https://stackoverflow.com/questions/52271574/weird-bug-with-native-html-and-zk-if
cor3000 ( 2018-09-17 10:50:30 +0800 )edit-
FEATURED COMPONENTS
First time here? Check out the FAQ!
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?
ZK Fiddle: http://zkfiddle.org/sample/3ikg0ch/3-Weird-bug-with-native-HTML-and-zk-if
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
also on stackoverflow: https://stackoverflow.com/questions/52271574/weird-bug-with-native-html-and-zk-if
cor3000 ( 2018-09-17 10:50:30 +0800 )editAsked: 2018-09-11 16:19:04 +0800
Seen: 15 times
Last updated: Sep 18 '18
Additional tags which I can't create: native-html, conditional-rendering
digulla ( 2018-09-11 16:20:03 +0800 )edit