Xavier
Posts: 0
Joined: Wed Oct 29, 2014 8:09 pm

How to make a list of lists

Hi,

I am trying to display a list of contact and, for each contact, the list of his adresses.
It is therefore a list of lists.

I added a contactService.
The Mapping is the one shown in the screenshot joined to this message.
As a result, nothing appears.

If I delete the "addresses[$i]" to "mobilelistitem_62" association, it lists the contacts (1rst list works !!) but gives only one addresse per contact (despite some of the contacts have several addresses).

Do you have any clue about the error I made ?

Thanks in advance
Best regards
Xavier Image

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

How to make a list of lists

Hi Xavier,

Here is a solution for two level nested list. Also you can improve it to x-level like you need.

At first you need to create two level service.

Please use for these goals "Generic service". You should to implement service manualy in accordance with your needs.

Take a look how to implement generic service in appery.io: http://docs.appery.io/documentation/u...

Note: your own generic service should return two-level array.

Secondly(when you will have two-level response service):
1 put first-level grid on the page.
2 put second-level grid in the first-level grid. http://prntscr.com/4ggd8z/direct
3 navigate to "data" page mode and add your two-level service to the page.
4 Click "Edit mapping".
5 Create two-level mapping like on screen shot: http://prntscr.com/4ggek8/direct
6 Invoke this datasource on the "page show" event.

That's all.

Regards.

Humberto
Posts: 0
Joined: Tue Jun 02, 2015 6:40 pm

How to make a list of lists

Xavier, where you able to solve this? I am trying to similarly with the Contacts service trying to show the Contacts and all the phone numbers in the phoneNumbers collection and I get the same result as you. So the only way I foun is creating a second service and call it twice with different mappings but it is slower.

Return to “Issues”