0

Is there a way to do the following in Moqui?

Say I have a list of parent categories (or classifications etc.)... Taking Request categories:

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

And I want to use 'parentCategoryList' to produce a sub-list for EACH parent category, to display separate form-lists on screen:

Something like:

  <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>

Then use that 'listOfLists' to iterate a form-list, supplying the form-list 'name' and 'list' sequentially for each list in the list. (I know you can't use iterate outside of actions, and you can't use forms inside of actions.)

I may well be thinking about this in the wrong way.

Ronan Keane
  • 189
  • 8

1 Answers1

0

You can iterate within the screen.widgets element, just use section-iterate. There are limitations to how much you can nest these (the current template macros for XML Screens/Forms only support so much), but you can do quite a bit. There are example of this in SimpleScreens, like the OrderDetail.xml screen iterating over order parts.

David E. Jones
  • 1,721
  • 1
  • 9
  • 8