Parent List record action to open child list (parent-child between 2 CRUDS)

Confluence User - 04 Sep, 2024

I have a CRUD page list. I need a record action in the list to open a popup page that has another CRUD list that is filtered based on previous selected record. This is a parent-child pattern.

datalists;forms;parent;child;crud

8


06 Sep, 2024
confluenceUser
confluenceUser

A few ways:
1. You could consider Nested List Formatter - Knowledge Base for DX 8 - Joget | COMMUNITY

2. don't use a CRUD, but use a list in the UI Builder. then add hyperlink action set to child menu id in list builder

3. in CRUD menu in UI Builder there's action's list CRUD Menu - Knowledge Base for DX 8 - Joget | COMMUNITY

06 Sep, 2024
confluenceUser
confluenceUser

Thanks but I didn't get them.

Maybe I wasn't very clear. I need the child list to have all the crud functions. That's why I wrote 2 cruds. In the first solution the child list does not contain any such function. It is read-only. There are no add, edit, and delete functions!

The other two were not clear to me.

In the second solution I create a list record action. In this action I define the url of the child crud menu (not the child list because its crud functions will be missing) and I pass the key of the parent list as url parameter. So far so good. It works. The child list shows only the records belonging to the parent record. But the problem is when you go to create a new child record using the child crud list. There the new record should somehow belong to the parent entry. One way is to pass the key of the parent record as a parameter when creating a new child record. Also the child form field corresponding to the foreign key should be hidden and pre-populated with the parameter. But how is this done?

However, I am surprised at the difficulty of creating such a common pattern!


06 Sep, 2024
confluenceUser
confluenceUser

The child should be a list UI Menu, not CRUD UI Menu. Use hyperlink action in list builder to create a "new" button with parameters to bring along the parentId. In the child edit form, create a hidden field with the value field set to the specific request parameter hash variable.


I'm a bit confused why you should do this when you can use grids (such as adv grid /form grid / list grid / spreadsheet) in the form builder to perform the same function albeit a heck of alot easier. Care to elaborate the use case? You got me curious lol

06 Sep, 2024
confluenceUser
confluenceUser

In the end if it doesn't work I will use what you mentioned. But for now I would like to evaluate what you suggest. I'll come back to the use case later

"The child should be a list UI Menu, not CRUD UI Menu".

crud operations (add,edit,delete) in the child list will be missing.

"Use hyperlink action in list builder to create a "new" button with parameters to bring along the parentId." 

If I understand correctly, in the child list we will create replacement of the crud operations using hyperlink action buttons?

And which url should I put in the hyperlink "new" action button? And what about edit and delete?


06 Sep, 2024
confluenceUser
confluenceUser

"If I understand correctly, in the child list we will create replacement of the crud operations using hyperlink action buttons?"

Yeap you got it. Fyi CRUD is the extended version of list. You won't find CRUD in Joget Community...so those who use community will have to manually create the add edit delete links on the list. 


"And which url should I put in the hyperlink "new" action button?

Use the crud as reference, when you click add on crud , copy paste the url and put into your new link + a parameter with your parentId 


"And what about edit and delete?"

Edit same case as add.

Delete I believe there's an action for delete in the list builder

 

 

11 Sep, 2024
confluenceUser
confluenceUser

Hello. I tried it and it worked. But with an issue that can not be ignored. When I click "New" the form is opened to add new record but when the form is closed then the parent list is not refreshed to show the new record. There aren't the actions that CRUD has in regards to post-save behavior.

11 Sep, 2024
confluenceUser
confluenceUser

which form is it referring to? if it's the child form, then it makes sense that it will only add record in the child table. (Assuming parent and child have different DB tables) by default. if you want it to perform further operations, you'll probably need to use a post-processing tool to update the parent table.

11 Sep, 2024
confluenceUser
confluenceUser

No. When a new record is added (in popup mode) in child list and then the popped up new form is closed. Behind is the child list which doesn't refresh to show the new record. Not to confuse you, in general I mean when you use list (instead of CRUD) to make new record operation using hyperlink action you do not have an obvious way to refresh the list that is behind and appears after the saved popped up "new record" form is closed.

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print