有没有办法在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'迭代表单列表,按顺序为列表中的每个列表提供表单列表'name'和'list'。 (我知道你不能在动作之外使用迭代,也不能在动作中使用表格。)
我可能会以错误的方式思考这个问题。
答案 0 :(得分:0)
您可以在screen.widgets元素中进行迭代,只需使用section-iterate。你可以嵌套多少这些限制(XML屏幕/表格的当前模板宏只支持这么多),但是你可以做很多事情。在SimpleScreens中有这样的例子,比如OrderDetail.xml屏幕迭代订单部分。