HTML5 Data Bindings Support Product Page

Solved

Repeat Region / Repeat Children Help Needed

Reported 01 May 2014 18:07:25
5
have this problem
01 May 2014 18:07:25 Steve Skinner posted:
Using one of my customer sites, I've built a test page that shows orders, but for the life of me I cannot figure out how to show the items for each order. I know this deals with parent children repeat regions but I cannot figure it out. Your video demos use custom JSON files instead of real database tables, so I cannot use your information to compare to my own. In that respect, the video demos regarding repeat regions and repeat children are not very helpful. Most data driven sites have real databases, not custom JSON files as in your examples.

I have two database tables:
- orders (contains shipping, billing, order summary information)
- order items (contains the items that are on each order

I have tried creating joins, but all that has done for me is given me a list of orders where each order ID is repeated for every item on the order.

My test page has a repeat region for the order list on the left, and a detail region on the right, which shows order information for each order when you click it on the left.

*** I need a repeat region inside my detail region which shows the items for the order, and that information comes from the orderItems table, and is related based on the OrderID.

My problem is partially not understanding how to set data connections so that this will work correctly. Someone following your video tutorials would be lead to believe that everything has to be all part of one data connection, but I have had no luck with that.

I have referenced the video for the HTML5 Formatter on Grouping, but that does not work for me because I need the repeat children region for order items to appear in the detail region, and not with the repeat region used for the order list, which is how your video tutorial instructs.

I have emailed my live test page to Teodor, since it is not something I want to be public, in that it deals with customer order information.

Replies

Replied 06 May 2014 14:40:44
06 May 2014 14:40:44 Teodor Kuduschiev replied:
Hi Steve,
I replied to your email today - please check it.
Replied 21 May 2014 21:54:07
21 May 2014 21:54:07 Brad Lawryk replied:
I also have this exact problem .... how was it solved?
Replied 21 May 2014 22:26:56
21 May 2014 22:26:56 Steve Skinner replied:
Hi Brad,

Teodor emailed me the working solution based on what I was doing. Here is how it all came together.

On the page you need 2 data sources (related by an ID).
  • First data source – for the order list
  • Second data source – for the individual items on each order
  • In the Detail region somewhere, use a hidden form field and assign the ID to it.
  • Create a repeat region using the second data source in the Detail Region.
  • Filter the second data source by the $FORM.hidden_field_id

When you select an order in the list, its details will be shown in the detail region and the order items will be filtered by the order number.
Replied 22 May 2014 03:43:51
22 May 2014 03:43:51 Brad Lawryk replied:
Thanks Steve,

That is pretty much what I was trying to do earlier. It makes sense that it would work. I will try again a bit slower and carefully as I must have done something not quite right.

Thanks for confirming what I was thinking and that I was on the right track.
Replied 22 May 2014 17:02:42
22 May 2014 17:02:42 Brad Lawryk replied:
Oh good lord .... the reason it wasn't working for me was I had my hidden form field inside a hidden region. All good now .... guess I needed more coffee.
Replied 22 May 2014 21:15:45
22 May 2014 21:15:45 Steve Skinner replied:
I hate it when that happens.
Replied 02 Jun 2014 05:18:09
02 Jun 2014 05:18:09 Julio C replied:
Hello Teodor,
Could you please explain the information you provided to Steve but with a gif/picture, or short video? I cannot make mine page work and I believe the solution is quite similar to Steve's.

After doing a search, I need the information to be populated in a way similar to Steve's, but I just cannot figure out the solution.

Thank you.
This reply was removed on 3/2/2016 8:41:08 PM.
See the changelog

Reply to this topic