Custom table records: aggregation and table display

Custom table records: aggregation and table display

  

Hi everyone,


I would like to generate a table records like this (see attachment) ...


2 tables: CITIES / COUNTRIES


I know the country of every city ...


Can I display the table records in this way ?



Thanks !


LUCA

Solution

Hi Luca,

If you have only a limited number of countries and cities, you could have on the main Screen a query that retrieves all countries and put that in a Table Records, and in the second column put a Web Block that receives the Id of the country (or whatever identifier you have for country in your cities Entity) and contains a Table Records displaying only the cities for its input parameter country. However, if you have a large number of countries or cities, this will be slow (since each country Table Row will execute a query as part of the Web Block).

Another option would be to query on the main Screen all cities with their country, and only display the country name the first time (by using an expression with direct indexing on the List, checking if the previous is the same, and in that case not displaying it). It will take some styling to get it vertically centered like that though, and perhaps a ROWSPAN extended attribute to span rows.

Solution

Thanks Kilian, I think I'll adopt your first solution ...


I'm gonna try it !


Thanks !

You're most welcome! Happy coding :)

Kilian Hekhuis wrote:

You're most welcome! Happy coding :)


Thanks Kilian ... I solved following your suggestion !