Unofficial Content

Parallel Grids included within a Web Panel Web Layout are Grid controls and/or Free Style Grid controls added in such a way that each one is independent of the other (none of them is inside another).

In this scenario, GeneXus determines a base table associated with each Grid / Free Style Grid.

It is important to highlight that GeneXus determines the base table of each Grid but does not look for nor establish relationships between them. In other words, GeneXus does not check if there are any common attributes in the Grids' base tables, and thus it does not define automatic filters. Therefore, the Grids will have independent or parallel navigations.

How GeneXus determines each Grid Base Table

For each Grid / Free Style Grid, GeneXus checks two possible scenarios:

1) If the Grid / Free Style Grid has its Base Trn property configured, that Base Table will be the Base Table of the Grid.

The attributes present in the following sections must belong to the Extended Table of the determined Grid Base Table (just like in a For each command):

  1. Attributes included in the Grid (visible or not).
  2. Attributes mentioned in the Order property.
  3. Attributes mentioned in the Conditions property.
  4. Attributes included in the Data Provider object invoked through the Grid Data Selector property.

Otherwise, it won't be possible to infer the values of these attributes.

2) On the other hand, if the Grid / Free Style Grid, doesn't have its Base Trn property configured, GeneXus determines the Grid base table by considering the attributes present in the 4 sections mentioned above. GeneXus calculates the smallest Extended Table of all possible extended tables containing all those attributes, and it chooses one base table that allows access to the calculated extended table.

Notes:

  • The attributes of the fixed part of the Web Panel object are not involved in the determination of the base table of any of the Grids, but they must belong to one of their extended tables (so that their values can be inferred). If this is not met, a warning notifying this situation will appear in the resulting navigation list.
  • The attributes used in the Web Panel events are not involved in the determination of the base table of any of the Grids, either. The attributes included in events outside the For Each commands must belong to the extended table of one of the Grids (just like those in the fixed part).
  • Grids do not necessarily have a base table.

Samples

Sample #1

Consider the following Transaction object Structures:

Country
{
   CountryId*
   CountryName
}

Customer
{
   CustomerId*
   CustomerName
   CustomerEmail
   CountryId
   CountryName
}

The following Web Panel object contains two Grid controls inside its Web Layout:

image_20241301557_1_png

Given that this Web Panel object contains more than one Grid in its Web Layout, GeneXus will determine a base table for each Grid.

In this example, each Grid has its Base Trn property configured. So,

  • The Grid1 (the one that appears on the top of the Web Layout) base table will be Country.
  • The Grid2 (the one located at the bottom of the Web Layout) base table will be Customer.

This means that,

  • GeneXus will navigate the Country table to retrieve and display its records in Grid1.
  • GeneXus will navigate the Customer table to retrieve and display its records in Grid2.

At runtime, the end user will see:

  • Grid1 loaded with all the Countries' records
  • Grid2 loaded with all the Customers' records.

As described before, GeneXus does not check if there are any common attributes in the Grids' base tables. In this example, CountryId is included in both Country and Customer, but GeneXus doesn't analyze that, and therefore no automatic filters are defined.

Sample #2

Consider the following Transaction object Structures:

Country
{
  CountyId*
  CountryName
  City
  { 
    CityId*
    CityName 
  } 
}

Attraction
{
  AttractionId*
  AttractionName
  CountryId
  CountryName
  CityId
  CityName
  AttractionPhoto
}

The following Web Panel object contains two Grid controls inside its Web Layout:

image_2024131232055_1_png

  • Grid1: It has a base table (CountryCity)
  • Grid2: It has a base table (Attraction)

The Web Panel contains a Parm rule that receives the CountryId attribute, as follows:

Parm(CountryId);

So, the CountryId value works as a filter for the whole object.

Therefore:

  • Grid1 shows the Cities of the CountryId received.
  • Grid2 shows the Attractions of the CountryId received.

As described before, GeneXus does not check if there are any common attributes in the Grids' base tables. So, the attractions (displayed in Grid2) will not be filtered by city (displayed in Grid1).

Triggering Events

Each Grid has its own separate Refresh and Load events, distinct from the general events associated with the entire Web Panel.

The sequence of event execution is as follows:

  1. Start event: This is a generic event that applies to both Grids.
  2. Refresh event: Another generic event that applies to both Grids.
  3. Grid1.Refresh: This specifically pertains to the Refresh event for Grid1.
  4. If Grid1 has a base table: Grid1.Load. This represents the Load event exclusively for Grid1.
  5. Grid2.Refresh: This is the Refresh event for Grid2.
  6. If Grid2 has a base table: Grid2.Load. This denotes the Load event for Grid2.

To perform loads on Grids without a base table, it is necessary to include the Load event directly within the Load event of a Grid.

Videos

Start Video Web Panel Object. Multiple Grids

See Also

Determining the Base Table for each Grid in a Web Panel
Nested Grids in Web Panels

Last update: April 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant