-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is binding to nested field of a list record supported ? #16
Comments
Hi albert-kam, nice to see you again. I am afraid nesting of lists mapping within another list mapping is not tested with the library but it could be generally possible. As a hint: Please try to first fill your form mapping with data (using FormMapping.fill method) and print the resulting structure using FormMapping.toString to first better understand generated names of nested form fields. And then possibly debug formMapping.bind (particularly BasicListFormMapping.bind). |
Hi again ! I tried filling and sysout the filled mapping, and i got this. Maybe there's a tiny bug in it. Please see the YeeHaw in the output to get where it fails.
Any pointers of where the issue might be ? |
Hi again, sorry to bump this topic. |
Hi, albert, I thought that builder.mappingType = MappingType.SINGLE; could be removed from BasicListFormMapping's bind and fillInternal method, but it is not that easy. It is correct when the LIST mapping becomes the SINGLE one with the index field filled up. It needs further investigation/debugging of BasicListFormMapping.bind and BasicFormMapping.getName for your test case. Could you debug BasicFormMapping.getName where the wrong example-myClasses-nestedOnes[0]-name is composed from "property name" of current mapping (with possible index) and name of parent? I don't think I will get to this soon. |
Hi,
Does formio currently support binding a nested list of nestable objects ?
For example i have this mapping:
And then this tests okay, because it's not trying to bind to the nested props of the list:
But when i try to bind to the nested field of the list record, it fails:
The expected structure is
The result structure is this:
Here is the junit test code. Basically its similar to the above, but with the class and builder definitions.
Any pointers would be greatly appreciated, thank you.
The text was updated successfully, but these errors were encountered: