How to refresh another area when a grid row changes
Summary
Using PRPC V6.2 SP2, you can refresh another area whenever the value of a property in a row of a grid changes. You can do this using Refresh When
conditions that support the full property reference syntax and enable you to mix-and-match different types of comparisons in the condition expression. You can reference the value of embedded properties anywhere within the current work object (pyWorkPage
clipboard page) or assignment.
To interact with a sample, select > User Interface> UI Gallery, and select Refresh On Change in the Combinations group.
This sample demonstrates using a Refresh When
condition to refresh another area when a property in a row of the grid changes. For example, when a user changes an employee's status in the All Employees grid, the appropriate list below, Full Time, Part Time, or Contract, refreshes and displays the employee's name.
This article shows you how the Refresh On Change sample in the UI Gallery is configured using the following features:
Building Dynamic UI: Actions and Events
- Run Data Transform
- Refresh Section
Formatting the Grid
- Fixed Height
- Freeze Row Pane
Viewing Data in the Grid
- Progressive Paging
- Sorting
Suggested Approach
Configuration
This sample is comprised of multiple grids. Changing a property in the top grid, All Employees, causes the All Employees grid to refresh, along with the grids on the bottom, Full Time, Part Time, and Contract. Prior to the refresh, a pre-processing data transform runs, which removes the pages from the Full Time, Part Time, and Contract page lists, and then refreshes them, appending the selected employee name to the applicable list.
Configuring the All Employees Grid
This is a repeating grid sourced from a Page List:
To view the configuration:
- In the Refresh On Change sample, click the open link.
- The
pxRefreshOnChange
section rule opens. On the Layout tab, click to display the wireframe. - In Layout 2, click the magnifying glass beside All Employees to open the Cell Properties panel.
- In the Cell Properties panel, click to open the
pxRefreshOnChangeAll
section. - On the Layout tab, click to display the wireframe and then click the magnifying glass beside the Repeat Grid to view the configuration.
This grid is sourced from a Page List and contains the employee name, .pyName
, and the employee status,.pyEmployeeType
.
The Employee Type grids are configured to refresh whenever the employee status, .pyEmployeeType
, in the All Employee grid changes.
Configuring the Employee Type Grids
Each list of employees, Full Time, Part Time, and Contract, is a repeating grid, the source of which is a Page List property. All three grids are contained within a single section that is refreshed whenever .pyEmployeeType
, in the All Employee grid, changes.
To view the configuration of these grids:
- On the
pxRefreshOnChange
section rule Layout tab, click to display the wireframe. - In Layout 3, click the magnifying glass in the Section Include.
- In the Section Include, click to open the
pxRefreshOnChangeGrouped
section. - This section is comprised of a Layout containing cells for Full Time, Part Time, and Contract. Each of these cells references an included section. For example, click the magnifying glass beside Full Time to open the Cell Properties. This cell uses the
pxRefreshOnChangeFull
section. - Click to open the
pxRefreshOnChangeFull
section. Notice that is a repeating grid with progressive paging. - Click the magnifying glass in the Repeat Grid.
- The Source for this grid is a page list property,
MetaData.pyFullTimeEmployees
.
The Full Time, Part Time, and Contract grids are all configured in the same way and sourced by the following Page List properties: MetaData
.pyFullTimeEmployees
, MetaData.pyPartTimeEmployees
, and MetaData
.pyContractEmployees,
respectively.
Refreshing the Employee Type Grids When the All Employees Grid Changes
The Full Time, Part Time, and Contract grids are contained within the pxRefreshOnChangeGrouped
section. This section, containing all three grids, is refreshed whenever the .pyEmployeeType
changes. Prior to the refresh, a pre-processing data transform runs, which removes the pages from the Full Time, Part Time, and Contract page lists, and then refreshes them, appending the selected employee name to the applicable list. A function runs which sorts the list and displays the employee names in alphabetical order.
To view this configuration:
- On the Layout tab of the
pxRefreshOnChange
section rule, click to display the wireframe. - In Layout 3, click the magnifying glass in the Section Include.
- Notice the Refresh When condition. Click the magnifying glass to open the Condition Builder and view the configuration.
- In the Condition Builder, note that the section is refreshed when
MetaData.pyAllEmployees.pyEmployeeType
changes. A data transform is configured to run prior to refreshing the section. Click to open the data transform. - Prior to refreshing the section, this data transform removes the pages from the Full Time, Part Time, and Contract Page Lists, and then refreshes them, appending the selected employee name to the applicable list. A function runs which sorts the list and displays the employee names in alphabetical order.
Note: You can also use the AddDelete
keyword to refresh a section when an item is added or removed from a list. For more information, see the PRPC online Help.