【问题标题】:Can I iterate form-lists in Moqui?我可以在 Moqui 中迭代表单列表吗?
【发布时间】:2016-04-30 13:07:52
【问题描述】:

有没有办法在 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”迭代一个表单列表,为列表中的每个列表依次提供表单列表“名称”和“列表”。 (我知道您不能在操作之外使用迭代,也不能在操作内部使用表单。)

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

【问题讨论】:

    标签: moqui


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-04-06
      • 1970-01-01
      • 2018-02-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-11-09
      相关资源
      最近更新 更多