Showing Parent/Child in a Single Table in Visual Builder by Shay Shmeltzer

image

Parent Child (or master detail) relationships are a very common structure of data, and sometimes people want to show this information in a single table – where for each row of the parent we also show the details of the children. (In SQL you get this type of presentation using a “group by” clause). Something that looks like this:

In the video below I show the basic steps to help you achieve this.

The first thing you’ll want to have is a REST endpoint that returns this “Tree” structure where we include the children in each parent. If you are working with business objects in Visual Builder, you’ll need to enable the accessor on the relationship between the master and the detail (0:05 in the vide). Keep track of that accessor name, as you’ll use it later in your code in a couple of places. Once you do this, you can pass this accessor name as the “expand” parameter to your REST call and the proper data structure can be returned. Next – store it in an Array in your page.

Now let’s turn to creating the UI.

In the demo I’m using a table, and in one of the columns I’m using a bind-for-each loop (line 8) to iterate over the children of the specific row and show them. Read the complete article here.

Developer Partner Community

For regular information become a member in the Developer Partner Community please register here.

clip_image003 Blog clip_image005 Twitter clip_image004 LinkedIn image[7][2][2][2] Facebook image Meetups

Technorati Tags: PaaS,Cloud,Middleware Update,WebLogic, WebLogic

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.