Troubleshooting active Overlay section with Refresh-Other Section specified
Learn how to avoid issues with active overlay and modal sections that are designed in your applications. Understand the negative effects of specifying the action Refresh-Other Section for an active overlay or modal section, especially when this action is specified on applications migrated from earlier Pega releases.
Sections in your application that are designed with an active overlay or modal close unexpectedly if the action Refresh-Other Section is specified and the other section is the launching section. The issue occurs when you Clicking Submitoverlay or modal closes when the launching element is no longer available. of the overlay or modal performs an implicit Refresh of the parent section that launched the overlay or modal. Consequently, the the overlay or modal and Refresh-Other Section is called when the overlay or modal is still in active state.
This issue is caused by a Pega defect. Refreshing the launching section is not a valid setting when an overlay or modal section is still in active state. Refreshing the launching section is implicitly handled after you close the overlay or modal section in the application. A defect correction in a future release will ensure that invalid settings are not allowed for overlay or modal sections when the launching element is not available.
However, even after the defect correction is made available in a future release, you should not use Refresh Other Section when an overlay or modal section is in Active state. See the best practice, Do not use Refresh-Other Section.
As shown in the following image, the button of an active overlay or modal section is launched by a local action designed with Refresh-Other Section specified. In this example, the section pzContent is the launching section. This means that it is the section that holds the associated element from where the overlay or modal is launched. When clicked, the button of the active overlay or modal section forces the overlay or modal to be closed.
To ensure the correct behavior of active overlay or modal sections in your application, choose one of the following solutions.
The first option is the easiest to implement and is the best practice. If not using or deleting the setting Refresh-Other Section is not feasible, choose one of the other solutions following the examples provided.
- Do not use Refresh-Other Section
- Use the Condition Builder to specify a When condition for Refresh-Other Section
- Use a Refresh When condition on a parent section to be refreshed
When an overlay or modal section is in Active state, do not specify the onClick action Refresh-Other Section. If Refresh-Other Section is specified, delete that setting.
Choose this solution if the other section to be refreshed is not a parent section.
If the form being submitted displays errors, create an activity in which you set a property using a When condition for Refresh-Other Section to prevent it from being called when the overlay or modal should remain open onClick of Submit.
For example, the following image shows the onClick action for Refresh-Other Section:
- For Target, specify Other Section.
- For Class, specify Data-Decision-Model-Training.
- For Section, specify pzSelectedRow.
- Select the check box Disable submit on refresh.
- For Conditions, specify When for Other Property .pyNote != “error”
In the example activity pzCreateNewEntity, the steps evaluating the When conditions for Property-Set-Messages call the Method Parameter .pyNote=”error”.
If the section to be refreshed is a parent section containing child sections that also need to be refreshed, then specify a Refresh condition on the section or layout that needs to be refreshed.
Ensure that the Refresh condition is evaluated and satisfied using the post-activity or post- dataTransform of the overlay or modal submission by correctly setting the property in the activity.
For example, the following image shows the Dynamic Layout Properties for a section pzContent:
- For Layout Format, specify Stacked.
- For Container Format, specify Default.
- For Refresh Condition, specify the property .pzReloadTracker(content)Changes.
In this example, the onClick Action for the Submit button of the overlay or modal is the activity pzReloadTrackerNotifier (instead of Refresh-Other Section). This activity, in which the Context parameter set to content determines whether to refresh the section by setting the Refresh When property.
Set the property.pzReloadTracker(Param.Context) in the When step Method call of the activity .pzReloadTrackerNotifier