Support Article
Layout is not getting collapsed after selecting the checkbox
SA-31923
Summary
When the user is selecting the checkbox,user have a functionality to collapse the layout using data transform. But when user selects two checkboxes even with ample amount of time gap, the layout is not collapsing.
Error Messages
Not Applicable
Steps to Reproduce
- Create a section and have a checkbox with onClick and onChange configured.
- onChange and onClick, configure PostValue, Data Transform to expand/collapse a layout, Refresh-This Section, Refresh-OtherSections(2), Refresh-CurrentHarness, Refresh-OtherSection.
- At runtime, check the checkbox and see the behavior.
Root Cause
An issue in the custom application code or design:
- As there are many refresh sections configured and a refresh harness, the request/responses might be slow.
- As the request/responses are synchronous and at times, when the server is slow, it might take huge amount of time, as a result of which user's request is not processed immediately.
Resolution
Perform the following design-change:
- For checkbox, two events(onClick, onChange) are not necessary. User can configure only one- onChange event would be sufficient in fulfilling the requirement.
- As Refresh-CurrentHarness is configured which refreshes all the sections in the current harness, Refresh-OtherSections are not needed.
- As there are multiple refreshes configured on the screen, the performance would be badly impacted.
- Local-change would be to enable/disable the checkbox using a flag value. Like, initially the flag would be true which will enable the checkbox. Before the first action, invoke data transform to disable the flag(set it to false) which will disable the checkbox and not allow users to act on the checkbox. After all the actions are completed, run the data transform to enable the flag(set it to true) which will enable the checkbox so that users can perform their action. Like this, you are dis-allowing the users by clicking on the screen multiple times.
- Another local-change would be to introduce a busy indicator on the screen so that end-users are informed that something is processing on the screen. User can follow this link for the script configuration(https://pdn.pega.com/support-articles/busy-indicator-not-displaying-after-modal-window-submit)
Published January 5, 2017 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.