-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Is it possible to use a template with a <ul> html tag?
<n:ul children="@load(vm.items)">
<template name="children" var="each">
<n:li>${each}</n:li>
</template>
</n:ul>
This does not work. But I want to do this exactly.
If your prefix n
mean zk 'native' namespace, then native HTML tags don't support data binding.
See https://www.zkoss.org/wiki/ZKDeveloper%27sReference/UIPatterns/HTMLTags
You can replace it with xhtml component set or <forEach>
:
<zk xmlns:n="native" xmlns:x="xhtml">
<zscript><![CDATA[
ListModelList items = new ListModelList();
items.add("a");
items.add("b");
]]></zscript>
<div apply="org.zkoss.bind.BindComposer">
<x:ul children="@load(items)">
<template name="children">
<n:li>${each}</n:li>
</template>
</x:ul>
<!-- native with forEach -->
<n:ul>
<forEach items="@init(items)">
<n:li>${each}</n:li>
</forEach>
</n:ul>
</div>
</zk>
Asked: 2023-01-29 09:01:12 +0800
Seen: 6 times
Last updated: Feb 01
bug with intboxes on mobile devices
zk keikai-how to add custom button/label to formulabar?
zk-keikai- update multiple cells parallel at same time asynchronously
zk-keikai-How to auto fit column width based on text
zk-keikai-ClipboardPateEvent-called twice
Reference a spring bean from VariableResolver