How to refer a property inside a pagelist in a section. It is not accepting < CURRENT >
I am building a section(DisplayEnrollment) which has properties from embedded pagelist inside the current pagelist(EnrollmentInfo) as well as few properties from the current pagelist.
I have created a data class with the structure of the current pagelist and also have embbeded data classes with those of embedded pagelist structure.(Addresses Data class is under EnrollmentInfo Data Class which houses the properties as street no, address line 1).
In DisplayEnrollment section I need to refer to the AddressLine1 and Streetno. In the property field of the DisplayEnrollment if I use.(.Addresses(1).AddressLine1) and similar, it works but if I use (.Addresses(<CURRENT>).AddressLine1) it does not work. Can we use some other keyword in place of the hardcoded index or is there some other approach that I can use.
1. As mentioned by Haritha you can use the repeat grid layout and you can give the reference of that pagelist -- If you want to display them in grid format.
2. If you want to display in another format you can use the Repeating Dynamic Layout with source pagelist(.Addresses) in DisplayEnrollment Section and refer the section created in Address Data Class which referes the properties directly(.AddressLine1).
My situation is a bit different. I cannot use a repeating grid for address line 1. I have the display enrollment section as a repeating dynamic layout and it is part of another section called DepartmentInfo. We are getting all the values from a service which has this complex embedded page structure. The problem is the fields inside the DisplayEnrollment Section are not referring all the fields from a pagelist. some are from a pagelist, some are from top level page. A snapshot of the design is attached.
from the screenshot I can see that your repeating dynamic layouts are using EnrollmentInfo pagelist. So <CURRENT> index will point to this pagelist. but for the embeded property .EnrollmentInfo(<CURRENT>).Addresses(?) is also a pagelist. How can you get the .Address(?) pagelist index if you are not using it inside a grid/repeat layout?
If you don't want to hard code the index then you might try reference property instead.
You are right. Addresses() is also a pagelist and the problem is the page structure is such, the section which needs to display them houses some of the properties at top level and some at a pagelist level which is creating this problem. I am unable to share the clipboard structure for the compliance of the project which might have helped to understand the issue better.