-
Let's say, like a user form as main form and addresses as a detail form allowing more than one address for each user. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
If I understand well, your need is to create users, and associate multiple addresses to each user ? I added an example to this repo: Data insertion for One-To-Many Relationships: Master-Detail Forms The main idea is to create two separate forms. The first one is an edition form for the already-existing user record, and the second is a form to add an address to the user. When you initially load the user creation form, we do not display the address form. Only when the user has been created, you are redirected to the user edition form that contains the address form. Does this solve your problem ? |
Beta Was this translation helpful? Give feedback.
-
So far, so fine. But insert_user.sql has a twist I don't understand: |
Beta Was this translation helpful? Give feedback.
-
Thanks for getting into all the detail -- TL;DR woulf have been plenty for my curiosity as I was already expecting this. However, one major question is still not answered: WHY would I want to use this pseudo-table when I have the actual table context still available?
and from there it's just reasonable to write
I'm sure there are situations to use excluded (but I have yet to find one ;) Oh, and while we're on it, maybe you should change the comments regarding sqllite in the master-detail-forms.sql code. |
Beta Was this translation helpful? Give feedback.
If I understand well, your need is to create users, and associate multiple addresses to each user ?
I added an example to this repo: Data insertion for One-To-Many Relationships: Master-Detail Forms
The main idea is to create two separate forms. The first one is an edition form for the already-existing user record, and the second is a form to add an address to the user.
When you initially load the user creation form, we do not display the address form. Only when the user has been created, you are redirected to the user edition form that contains the address form.
Does this solve your problem ?
How do you think the documentation could be improved to make this easier to discover ?