html li in template

asked 2023-01-29 09:01:12 +0800

agsiegel gravatar image agsiegel
6 1

updated 2023-01-29 09:03:34 +0800

Is it possible to use a template with a <ul> html tag?

<n:ul children="@load(vm.items)">
  <template name="children" var="each">

This does not work. But I want to do this exactly.

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted

answered 2023-02-01 10:10:15 +0800

hawk gravatar image hawk
3205 1 5
http://hawkphoenix.blogsp... ZK Team

updated 2023-02-01 10:18:44 +0800

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">
    ListModelList items = new ListModelList();
    <div apply="org.zkoss.bind.BindComposer">
        <x:ul children="@load(items)">
            <template name="children">
        <!-- native with forEach   -->
                <forEach items="@init(items)">
link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools




Asked: 2023-01-29 09:01:12 +0800

Seen: 6 times

Last updated: Feb 01

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