I've managed to redirect from a (search and) list-form to a front-end content-form to add children of specific content-type by passing parent-ID of Parent (from list). It works fine until I click "save and new" in the child-form. The item(child) is saved but the new empty form doesn't contain the parent_ID anymore because the URL-parameter (which was initially passed through by the list-form) is gone. Is there a way to keep or get the parent-ID in the URL-variable while using the "save-and-new"-button? I do not see such a possibility in the button-config.
Well, I've tried to turn this around and spend one day trying all possible combinations with button-free as well as save-and-new (submit)....
Maybe it's my lack of knowledge but I can't get it working the Seblods-way. With the submit-button option it's impossible to pass URL-parameters and with the button-free option it's possible to send parameters but nothing gets saved.
I guess I have to use "save and close" then control is returned to the list and then I've to hit again "add new child"-button... This is a pity because it's taking extra time (clicks).
If anyone has any idea how to stay in the "child-form" to add multiple children after each other without losing the parent-ID thery're welcome (:-
For now I'll try my luck figuring out session-variables although there is not information on the internet about this in Seblod.
I've managed to fix this with the help of session-variables and URL-extension (live value of current URL) together with codepack-etension (before-render and after-store).
My solution below:
In search-list-form (parent form):
1. Add icon field to redirect to child-content-form (menu-item) to add child-content
1. Create field (codepack - beforerender).
2. Add session-code (see below) to store URL of first add-content-form (this one contains parent-id in URL).
3. add free field containing URL of current add-form (set bij live-value: URL, custom (all checkboxes on)
4. Add after-store-code (codepack) field to set target-URL ($config['url’], which was saved on before-render), see code below.
Now you can use “save & new” as many times as you like without returning to the main search-list-form after every (child) save. The parentID is provided by replicating the first child-content-form-URL which is stored in session-var and restored in config-URL every time after child-save.
On adding last child-record user can use “save and close-button” so control will be returned to parent search-list-form.