Skip to Content (Press Enter)
OutSystems.com
Personal Edition
Community
Support
Training
Training
Online Training
Developer Schools
Boot Camps
Certifications
Tech Talks
Documentation
Documentation
Overview
ODC
O11
Forums
Forge
Get Involved
Get Involved
Jobs
Ideas
Members
Mentorship
User Groups
Platform
Platform
ODC
O11
Search in OutSystems
Log in
Get Started
Back to Forums
Gerry
7
Views
6
Comments
How to do a list within a list
Question
I have the need that for any record in a record list to potentially display several additional records for that record within that list (i.e. list within a list).
For example, in a Travel application, I want to display trips in a record list, and then display a sub-list for trips showing the additional passengers for that trip.
date type location departure_time arrival_time
xxxx xxxxx xxxxxxx xxxxxxxxxx xxxxxxxxxx
Additional passengers:
xxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxx
xxxx xxxxx xxxxxxx xxxxxxxxxx xxxxxxxxxx
xxxx xxxxx xxxxxxx xxxxxxxxxx xxxxxxxxxx
Additional passengers:
xxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxx
xxxx xxxxx xxxxxxx xxxxxxxxxx xxxxxxxxxx
...
Please let me know how this could be done in Outsystems.
Nuno Rolo
MVP
Hi!
Don't know if this is the only way or if it is the best. But if you want a List A (Id, Atribute A, Atribute B, List B).
First you have to create de List B with the atributes you want and after that you create List A and one of the atributes you add, set data type to Record list and the record definition to List B.
Hope it helps
enigma
i would have gone for this approach:
create webblock1: ie. Flights
set an input record for the flight
and build the flight table
create webblock2: ie. Passengers
set an input record for the passenger
and build your passengers table
if there are no passengers, dont display the table
now for webblock3 or your screen:
create a structure with 2 fields (flight_id and text)
and create a table based on this structure, but only show the text column
append all flights you want to display to this table
and finally drag-drop your webblock1 and 2 into the text column
also you will have to move the header from webblock1 to webblock3 and process sorting separately
unless you want a repeating flight header
but this way you should be able to get 1 table,
where the subtable (passengers) doesnt have to be on the same line as the flight
Luis Soares
Hello,
I know a way that you can do that using grouping sets but it only works on SQL Server 2008 or higher version.
If you need some samples check the post on my blog about it:
https://learnagile.blogspot.pt/2012/04/sql-server-2008-grouping-sets-in-sql.html
For more information about sql server grouping sets syntax i would suggest you can check the following link:
https://msdn.microsoft.com/en-us/library/ms177673.aspx
There's other ways they but they can be more
inefficients
, like building a string with the dynamic html code (table) and use it on the screen as a expression with Escape Content = No.
Hope it helps...
Best regards,
Luis Paulo Soares
Gerald Seidl wrote
:
I have the need that for any record in a record list to potentially display several additional records for that record within that list (i.e. list within a list).
For example, in a Travel application, I want to display trips in a record list, and then display a sub-list for trips showing the additional passengers for that trip.
date type location departure_time arrival_time
xxxx xxxxx xxxxxxx xxxxxxxxxx xxxxxxxxxx
Additional passengers:
xxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxx
xxxx xxxxx xxxxxxx xxxxxxxxxx xxxxxxxxxx
xxxx xxxxx xxxxxxx xxxxxxxxxx xxxxxxxxxx
Additional passengers:
xxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxx
xxxx xxxxx xxxxxxx xxxxxxxxxx xxxxxxxxxx
...
Please let me know how this could be done in Outsystems.
2 replies
Last reply 19 Apr 2012
Show thread
Hide thread
Gerry
Luis Paulo Soares wrote
:
Hello,
I know a way that you can do that using grouping sets but it only works on SQL Server 2008 or higher version.
If you need some samples check the post on my blog about it:
https://learnagile.blogspot.pt/2012/04/sql-server-2008-grouping-sets-in-sql.html
For more information about sql server grouping sets syntax i would suggest you can check the following link:
https://msdn.microsoft.com/en-us/library/ms177673.aspx
There's other ways they but they can be more
inefficients
, like building a string with the dynamic html code (table) and use it on the screen as a expression with Escape Content = No.
Hope it helps...
Best regards,
Luis Paulo Soares
Gerald Seidl wrote
:
I have the need that for any record in a record list to potentially display several additional records for that record within that list (i.e. list within a list).
For example, in a Travel application, I want to display trips in a record list, and then display a sub-list for trips showing the additional passengers for that trip.
date type location departure_time arrival_time
xxxx xxxxx xxxxxxx xxxxxxxxxx xxxxxxxxxx
Additional passengers:
xxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxx
xxxx xxxxx xxxxxxx xxxxxxxxxx xxxxxxxxxx
xxxx xxxxx xxxxxxx xxxxxxxxxx xxxxxxxxxx
Additional passengers:
xxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxx
xxxx xxxxx xxxxxxx xxxxxxxxxx xxxxxxxxxx
...
Please let me know how this could be done in Outsystems.
I did this with addtional lists and widgets in web blocks and it works well. Thanks to everyone for the help!
Luis Soares
Hello,
Yes it works fine but it also make 1 more database access per record. If the table doesnt have many records it works fine. Its more inefficient and slowly and not recomended for reportings with a high volume of data.
Gerald Seidl wrote
:
Luis Paulo Soares wrote
:
Hello,
I know a way that you can do that using grouping sets but it only works on SQL Server 2008 or higher version.
If you need some samples check the post on my blog about it:
https://learnagile.blogspot.pt/2012/04/sql-server-2008-grouping-sets-in-sql.html
For more information about sql server grouping sets syntax i would suggest you can check the following link:
https://msdn.microsoft.com/en-us/library/ms177673.aspx
There's other ways they but they can be more
inefficients
, like building a string with the dynamic html code (table) and use it on the screen as a expression with Escape Content = No.
Hope it helps...
Best regards,
Luis Paulo Soares
Gerald Seidl wrote
:
I have the need that for any record in a record list to potentially display several additional records for that record within that list (i.e. list within a list).
For example, in a Travel application, I want to display trips in a record list, and then display a sub-list for trips showing the additional passengers for that trip.
date type location departure_time arrival_time
xxxx xxxxx xxxxxxx xxxxxxxxxx xxxxxxxxxx
Additional passengers:
xxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxx
xxxx xxxxx xxxxxxx xxxxxxxxxx xxxxxxxxxx
xxxx xxxxx xxxxxxx xxxxxxxxxx xxxxxxxxxx
Additional passengers:
xxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxx
xxxx xxxxx xxxxxxx xxxxxxxxxx xxxxxxxxxx
...
Please let me know how this could be done in Outsystems.
I did this with addtional lists and widgets in web blocks and it works well. Thanks to everyone for the help!
enigma
i have to agree with the performance point of luis
although this could alternatively also be handled with 1 select in the main screen
plus some actions that spread (append) the main records to the according webblocks
or depending on the requirement, gerry can also show all flights for a 1st
and have a button to expand the passengers sub-table
so passengers are only selected when explicitly requested by the user
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
See the full guidelines
Loading...