Question
<pega:forEach in <pega:forEach
I am trying to reference properties in an embedded page list that is in a page list using a forEach inside of a forEach. Page context looks like: pyWorkPage.Policies.pxResults().TRXFlows.pxResults.
<p>
<table>
<tr style="border: 2px solid black;width:auto;color:black;weight:bold">
<th style="border: 2px solid black;width:auto;background-color:lightgrey">Nature of Transactions</th>
<th style="border: 2px solid black;width:auto;background-color:lightgrey">Name of Related Party</th>
<th style="border: 2px solid black;width:auto;background-color:lightgrey">Amount(HUF)</th>
</tr>
<pega:forEach name ="pyWorkPage.Policies.pxResults">
<tr style = "border: 1px solid black">
<td style = "border: 1px solid black;width:auto; text-align: left">
<pega:reference name="$this.ProductName"mode="normal"></pega:reference>
</td>
<pega:forEach name="$this.TRXFlows.pxResults">
<td style = "border: 1px solid black;width:auto; text-align: left">
<pega:reference name="$this.BUYER_SD_NAME"mode="normal"></pega:reference>
</td>
<td style = "border: 1px solid black;width:auto; text-align: left">
<pega:reference name="$this.TotalAmount"mode="normal"></pega:reference>
</td>
</pega:forEach>
</tr>
<tr style = "border: 1px solid black">
<td style = "border: 1px solid black;width:auto; text-align:left">Subtotal Amount</td>
<td style = "border: 1px solid black;width:auto; text-align:right">
<pega:reference name="$this.TotalAmount"mode="normal"></pega:reference>
<td style = "border: 1px solid black:width:auto; text-align:right">
</td>
</td>
</tr>
</pega:forEach>
</table>
</p>
My resulting page does not show BUYER_SD_NAME or TotalAmount for the second embeded page group
Is there another tag I can use or am I referencing the page incorrectly?
I don't have a quick answer, but two ideas:
1) Try using more standard auto-generated section, so you'd convey what you want with repeat-row-grids, and then you wouldn't have to code the FOREACH loops yourself.
2) If for some reason you really need to use non-auto-generated section, try an auto-generated one anyway, and then look at the generated java so you can see how it does it, and even copy pieces to make yours work.
/Eric