Question
AreteansTech
AU
Last activity: 31 Aug 2022 6:44 EDT
Save value in page-list from a non auto-generated HTML
Hi all,
I'm working on a POC that involves dynamically populating a UI, where the label and input type are sourced from a page list, and the user input needs to be saved in the list on Submit.
JSON payload that is converted to a pagelist:
[
{
"FieldName": "First name",
"FieldType": "text"
},
{
"FieldName": "Last name",
"FieldType": "text"
},
{
"FieldName": "Post code",
"FieldType": "number"
}
]
The non auto-generated UI code:
<pega:forEach name="pyWorkPage.FieldList">
<label><pega:reference name="$this.FieldName" /></label><br>
<input type="<pega:reference name="$this.FieldType" />"><br>
</pega:forEach>
This works fine, and the UI is populated as expected.
Now I need to save the user input against each element in the list. I.e.: If the user enters "John" as his first name, the value "John" should be saved in pyWorkPage.FieldList(1).FieldValue
Appreciate any input on how this can be achieved.
Thanks in advance.
Lahiru.
***Edited by Moderator Marije to add Capability tags***