Expand my Community achievements bar.

SOLVED

binding from data model 1 to many into adaptive form

Avatar

Level 5

I have this two tables.... and there is a relationship of one to many

one pcx_casemotion to many acms_portalcaseplayer

1828624_pastedImage_0.png

this is the JSON data that it produces as you can see there are 14 acms_portalcaseplayer(s)

1828766_pastedImage_1.png

on my adaptive form i want to bind the acms_anumber to that field below.

1828767_pastedImage_2.png

what is not clear is:

how do I bind the [5] object of the 14 ??

is there an specific bind reference format?

does the model need to pass more arguments to get to the [5] object of the acms_portalcaseplayer?

Thanks

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

you will have to change the form data model get service appropriately to return the child you want

View solution in original post

6 Replies

Avatar

Employee Advisor

you cannot bind a specific element inside a repeating data set

you will have to bind the entire data set to a table

Avatar

Level 5

workflowuser let me understand this.... what I am trying to do is not possible? is AEM forms supposed to work only with one table? and if it has any one to many relationships? the children of the parent object can only be shown on a GRID?

Avatar

Employee Advisor

if you have repeating set of data like dependants or credit card transactions, you cannot bind the 3 rd dependant or the 5th transction

you will have to display all the dependants or the transactions in a table.

Look for Amortization Schedule sample in  Aem Forms Samples 

Avatar

Level 5

workflowuser​ Unfortunaly my form does not need to show all the other children of the parent at once. it only needs to show one of them and not in a table but on respective fields so that they can be changed.

this is then a limitation of AEM if I am understanding correctly.

Avatar

Correct answer by
Employee Advisor

you will have to change the form data model get service appropriately to return the child you want

Avatar

Level 5

passing an argument for the parent and for the child you want is how it works. that one it only retrieves 1 child and the association needs to be 1 to 1 if you want to bind to specific fields if you do it 1 to many then yes you cant and will have to use a table.