0
<window apply="org.zkoss.bind.BindComposer"
    viewModel="@id('vm') @init('com.test.labelTest')">

    <template <!--model = "@bind(vm.allLabelSets)" some thing like this --> >
        <label value="@load(each.label1)" />
        <label value="@load(each.label2)" />
        <label value="@load(each.label3)" />
    </template>

</window>

list我们如何在不使用任何的情况下使用模板来迭代 a gridModel,treeModel

4

1 回答 1

0

Try this below code

<vlayout id="vlayout" children="@bind(vm.allLabelSets) @template('record')">
    <template name="record" var="record">
        <vlayout style="padding-left:10px; border:2px solid green;" >
         <label value="@load(each.label1)" />
         <label value="@load(each.label2)" />
         <label value="@load(each.label3)" />

        </vlayout>
    </template>
</vlayout>

You have to use children attribute

于 2013-12-13T13:04:28.707 回答