Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Unable to collapse an expanded section with ExpandWhen condition



User has configured a expand or collapsible dynamic layout. On section launch, the dynamic layout expands based on a condition in Expand When. The section or layout has to be collapsed on click of a button. This button is configured with onclick - run activity which changes the flag that is used in expand when (When rule), but the section does not collapse on click of this button.

Error Messages

Not Applicable.

Steps to Reproduce

1.Include a dynamic layout of Expand/collapse Header in a section.
2.In Expand use a When rule, which checks the condition of a property(Flag).
3.Include a 'OK' custom button on which refresh this section and refresh-otherSection where an activity is called to set the flag so that the section collapses.
4.A pre-Acivity is included in the flow action which will set the flag in a way that the when condition in the expand pane turns out to be true and hence section is expanded on loading of the screen.

Root Cause

This issue was determined to be a product enhancement request.

As per current design, Expanded when resulting to false does not collapse the container. As of now, Pega does not have support to collapse a container.
This was designed long back (may be in version 5) and needs proper design revisit. This is seen as a major change as this involves visiting many components say for example: layout groups (accordion version).
This is already taken up as an Enhancement and Pega is in plan of implementing this in future release Pega 7.2.2.


In Pega 7.2, the below local-change solves the issue:
On button click, Refresh-Other section action, set pre-activity say “SetFlag

Instead of toggling the flag property, toggle the param.EXPANDEDSubSectionTestSecB where TestSec is the section name, as one can see in the above pic.

The param name changes based on the section name. Like for ex: If the Section name is Sec_86915 then param name will be param.EXPANDEDSubSectionSec_86915B
One can get the param name from the div which has id=”EXPAND-OUTERFRAME”.


Published July 28, 2016 - Updated October 8, 2020

Was this useful?

100% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us