3 Replies Latest reply: Dec 7, 2012 9:54 AM by Alejandro Tovar Lanz RSS

    Adf nested ForEach

    Alejandro Tovar Lanz
      Hi Guys,

      I have a requirement like this post:

      Re: Nested Iterator - Master Detail Listing

      Where I have a viewObject linked to it I have another viewObject. Basically I want to do something like

      ForEach (parent) --- Print Parents
      ForEach(Child) -- Print Child

      But I can't make child to get refreshed. It just print the first child of the first parent and that's it. Any suggestions????
        • 1. Re: Adf nested ForEach
          user404
          Not sure if this works with for ech but when using iterators you can add a hidden column (or something similar) at the end of each row (master).
          In that hidden column/or whatever you trigger a method in your backing bean which manipulates the child iterator so it has the correct values.
          • 2. Re: Adf nested ForEach
            Frank Nimphius-Oracle
            Hi,

            use a tree binding that has two hierarchies. Then on each node (the variable of the parent forEach loop call #{variableName.children} to populate the variable for the detail loop

            Frank
            • 3. Re: Adf nested ForEach
              Alejandro Tovar Lanz
              Hi Frank,

              I did add the two hierarchy (add rule??). this is what I have:
              <af:forEach varStatus="stat" begin="0"
              end="#{bindings.TeamSearchVOIterator.estimatedRowCount -1}"
              var="parent">
              <af:forEach varStatus="statST" begin="0" var="subTeam"
              items="#{parent.children}">
              But it doesn't work. Although I might be missing something: My page definition looks like:
              <tree IterBinding="TeamSearchVOIterator" id="TeamSearchVO">
              <nodeDefinition DefName="model.queries.TeamSearchVO"
              Name="TeamSearchVO0">
              <AttrNames>
              <Item Value="LastName"/>
              <Item Value="UserName"/>
              <Item Value="UserId"/>
              </AttrNames>
              <Accessors>
              <Item Value="SubTeamSearchVO"/>
              </Accessors>
              </nodeDefinition>
              <nodeDefinition DefName="model.queries.SubTeamSearchVO"
              Name="TeamSearchVO1">
              <AttrNames>
              <Item Value="PpfFirstNamePpfLastName"/>
              <Item Value="SupervisorId"/>
              </AttrNames>
              </nodeDefinition>
              </tree>
              I cant see on my binding page anything related with SubTeamSearhVO whatsoever.