How to refer outer loop property in HTML/JSP tags

I want to loop through multiple PageList/Group in HTML/JSP tags and need to refer outer properties to form a table. I can refer immediate loop property but not the outer one. Below is the HTML snipet I am trying to build

<pega:foreach name="Top.Applicant"><br />

Documents requested from  <span style="font-size:11.5pt"> <span style="color:fuchsia"><pega:reference name="$this.FullName"></pega:reference></span></span>:<br />

 

<table class="customTable" style="background-color: #EAE8E9">

    <tbody>

        <tr>

            <td style="width: 150px;">Document<span style="font-size:14px"><span style="font-family:OpenSans,sans-serif"> </span></span></td>

            <td style="width: 400px;">Requirement<span style="font-size:14px"><span style="font-family:OpenSans,sans-serif"> </span></span></td>

        </tr>

    </tbody>

</table>

<pega:foreach name="$this.DocumentCategory"> <pega:foreach name="$this.DocumentsType"> <pega:foreach name="$this.DocumentList">

<table class="customTable">

    <tbody>

        <tr>

            <td style="width: 150px;"><pega:reference name="$this.DocType"></pega:reference> <span style="font-size:14px"><span style="font-family:OpenSans,sans-serif"> </span></span></td>

            <td style="width: 400px;"><pega:reference name="**Want to Use upper loop property here**"></pega:reference> <span style="font-size:14px"><span style="font-family:OpenSans,sans-serif"> </span></span></td>

            <td style="width: 400px;"><pega:reference name="$this.DocumentsName"></pega:reference> <span style="font-size:14px"><span style="font-family:OpenSans,sans-serif"> </span></span></td>

        </tr>

    </tbody>

</table>

</pega:foreach></pega:foreach> </pega:foreach> </pega:foreach>

Please suggest any solution

@MRIDULSIL I see that you are looping through nested page list there are couple of ways to achieve it.

<pega:forEach name="MyPageList"> 

<pega:withEmbedded name="$this" > <pega:reference name=".MyInnerValue" /> Here the Primary page will be PageList which you are iterating, you can look up the value from primary page </pega:withEmbedded> </pega:forEach>.

 

2. Other option is u can seperate the HTML Rules and for every iteration inclue the HTML rule

<pega:forEach name"MyPageList">

<pega:withEmbedded name="$this">

<inclue your HTML Rule Here> (Inside the HTML Rule the Primary Page will be your iterator page and you can directly refer the properties.

</pega:forEach>

  1. Other option is to save the variables using <pega:save name=“saveValueName” ref=“$this.propertyName”> and refer the same inside the Nested Each.

@Abhilash_K Thank you Abhilash