binding from data model 1 to many into adaptive form

Avatar

Avatar

ayecona

Avatar

ayecona

ayecona

06-09-2019

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

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

workflowuser

Employee

Avatar

workflowuser

Employee

workflowuser
Employee

06-09-2019

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

Answers (5)

Answers (5)

Avatar

Avatar

ayecona

Avatar

ayecona

ayecona

06-09-2019

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.

Avatar

Avatar

ayecona

Avatar

ayecona

ayecona

06-09-2019

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

Avatar

workflowuser

Employee

Avatar

workflowuser

Employee

workflowuser
Employee

06-09-2019

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

Avatar

ayecona

Avatar

ayecona

ayecona

06-09-2019

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

Avatar

workflowuser

Employee

Avatar

workflowuser

Employee

workflowuser
Employee

06-09-2019

you cannot bind a specific element inside a repeating data set

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