0

有没有办法在 Moqui 中执行以下操作?

假设我有一个父类别(或分类等)列表......以请求类别:

    <entity-find entity-name="mantle.request.RequestCategory" list="parentCategoryList">
        <econdition field-name="parentCategoryId" operator="is-null" /> 
    </entity-find>

我想使用“parentCategoryList”为每个父类别生成一个子列表,以在屏幕上显示单独的表单列表:

就像是:

  <iterate list="parentCategoryList" entry="thisCategory" >

    <entity-find entity-name="mantle.request.RequestCategory" list="categoryList">
        <econdition field-name="parentCategoryId" from="thisCategory.requestCategoryId" />
    </entity-find>

    <!-- I include the following only to give an idea of what I am trying to do. 
    It is incorrect and incomplete -->

    <script>listOfLists.add(categoryList)</script>

  </iterate>

然后使用该 'listOfLists'迭代一个 form-list,为列表中的每个列表依次提供 form-list 'name' 和 'list'。(我知道您不能在操作之外使用迭代,也不能在操作内使用表单。)

我很可能以错误的方式思考这个问题。

4

1 回答 1

0

您可以在 screen.widgets 元素中进行迭代,只需使用 section-iterate。您可以嵌套多少是有限制的(XML 屏幕/表单的当前模板宏仅支持这么多),但您可以做很多事情。在 SimpleScreens 中有这样的例子,比如 OrderDetail.xml 屏幕迭代订单部分。

于 2016-04-30T05:07:52.970 回答