Applies to Pega Platform versions 7.2 through 8.3.1
Typical scenarios for designing nested grids
Limitations that interfere with nested grid behavior
Typical scenarios for designing nested grids
As an application developer designing nested grids (grids inside of other grids) in Pega applications, you are apt to use the following approaches:
- Design a grid that contains cells and columns. In one of the columns, you design a section that includes another grid.
- Design a grid with rows that can be displayed in an expanded pane that contains another grid. Edits made to one row of the expanded pane are saved when the next row is selected for editing.
- Design a grid with rows that can be displayed in an embedded pane that contains another grid. Edits made to one row of the embedded pane are saved when the next row is selected for editing.
Errors
You might see an error on the screen or in the logs similar to the following examples:
Unable to determine value for <current>; reference is to a named page different from the starting context
com.pega.pegarules.pub.clipboard.InvalidParameterException . . .
Limitations that interfere with nested grid behavior
The design scenarios identified above work well, unless you encounter errors caused by the following limitations:
A paging-enabled grid inside a paging-enabled grid causes name conflict corruption
A nested grid’s styles are applied from the outer grid
Inline nested grids with row editing using inline mode do not work and display in read-only mode
Refresh section runs the activity in the wrong context
Refresh when property changes does not work in the grid as expected
Clicking Add Item on Repeating Grid does not respond sometimes
A paging-enabled grid inside a paging-enabled grid causes name conflict corruption
This issue occurs only in cases where both the inner and outer grids are visible on load. Why? Because all paging-related parameters at the end of the grid layout are nullified in grid generation. Therefore, the generation of one grid corrupts the other grid’s parameters because the parameter names of both grids are the same.
Solution
- Maintain individual parameter pages for each grid.
- Maintain some index in the parameter name to uniquely identify each grid’s parameters.
- Scope the parameter page to the section level.
A nested grid’s styles are applied from the outer grid
When you include a Spreadsheet grid in the Expand Pane of a Transparent grid, then the inner grid, the Spreadsheet grid, inherits the styles of the outer grid, the Transparent grid. Why? Because the styles of the outer grid (the parent) always override the styles of the inner grid (the child).
Generating styles for all combinations of nested grids impedes performance. In addition to the inheritance of the parent grid styles by the child grid, the three grid styles are generated in order of precedence: Spreadsheet, Transparent, and Default.
Solution
Use the following code example when a grid with Spreadsheet style is inside a grid with Transparent style to apply the new style blocks as Spreadsheet:
- Div.Transparent Div.Spreadsheet .. { Spreadsheet style blocks; }
A report definition grid in the second level of a nested grid causes errors and displays incorrect data
In this scenario, an Expand Pane grid has a flow action that is bound to a report definition. The flow action refers to a grid that is bound to the report definition and the report definition accepts dynamic parameters. At run time, when the application user expands a row of the top-level grid, a top-level page is created with results of the inner report definition grid. When the user expands another row of the grid, the top-level page is replaced with the new results of the report definition. Because the inner grid is also of Expand Pane mode, expanding any row causes errors and sometimes shows incorrect data.
Solution
A flow action embedded in a grid does not work as expected in a collapsible section that contains another collapsible section
Your application has a section designed for Expand or Collapse All. Within that section is embedded another section designed for Expand or Collapse All. From the top embedded section, open a local flow action and Submit it. The bottom-level Expand or Collapse All section is hidden.
Solution
Inline nested grids with row editing using inline mode do not work and display in read-only mode
Your application has nested grids with inline mode row editing. On initial load, the section containing the nested grids is loaded as read-only. Notice that the nested grid section <div> displays the “readonly” attribute.
Solution
Refresh section runs the activity in the wrong context
Solution
Refresh when property changes does not work in the grid as expected
Solution
Clicking Add Item on Repeating Grid does not respond sometimes
Steps to reproduce
- Create a Repeating Grid with Master-Detail enabled for modal dialog (pop-up window) mode for editing the rows of the grid.
- To the Detail window, add two layouts within the sections.
- In the first layout, add a Dropdown control that updates and refers to pyWorkPage and the same Page that the Repeating Grid uses.
- Design the second layout as a Repeating Grid layout, making the grid a nested grid, and include the buttons labeled Add and Delete for adding and deleting rows.
- On the grid’s Master page, click Add to add an item in the Detail page pop-up window (the modal dialog box) and see how the Add action works as expected. On the added item, click Delete to delete it and see how the Delete action works as expected.
- In the Detail page pop-up window, click Cancel to close the Detail page and return to the Master page.
- On the Master page, click Add again to add an item in the Detail pop-up window, but notice that the Add button does not work.
Explanation
Repeating Grid with Master-Detail enabled for row editing does not work for actions in nested grids.
Solution
To prevent or resolve this problem, place the Dropdown control and the inner grid of the grid hierarchy in the same section.
Solutions
First, determine the root cause of the nested grid problem by trying the Debugging techniques.
Then try one of the Suggested local changes.
Debugging techniques
Try any one or all the following actions to determine the root cause of the nested grid problem.
Whenever a nested grid does not work as expected, take the following steps:
1. Check for the Errors that usually appear in run time.
2. Check to see if the nested grid design falls into one of the problem scenarios described in Limitations that interfere with nested grid behavior.
Suggested local changes
To overcome or avoid the Limitations that interfere with nested grid behavior, try the following local changes when developing your application:
- Replace a problematic nested grid (an inner grid) with a repeating dynamic layout.
- In a nested grid design where both the outer grid and the inner grid are paginated, take one of the following actions:
- Disable pagination in one of the grids.
- Move the grid to a dynamic layout and specify Defer Load for that grid.
- In a nested grid design where both the outer grid and the inner grid use Expand Pane mode, change either the inner grid or the outer grid to a modal dialog grid.
Related Content
How to add a Grid layout to a section
How to display row details in expanded panes in a repeating grid