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

Expand when does not work for Repeating Dynamic Layouts

SA-4334

Summary


Section A is collapsible and contains a grid repeat layout. It is embedded in its parent, section B. Section A should be expanded when a row selection has not been made and collapsed once a selection has been made. When a user clicks a row in the grid repeat layout in section A , copy the selection and refresh the parent section B. When the parent section B refreshes, the collapsible header ends up expanded. On refreshing the whole harness instead of the parent section B, section A is collapsed.

Resolution



This works as per the design. Expand when configuration honors the state of layout in design time and executes the when rule only during initial load. But once the layout is expanded manually or through server side when condition, it remains in expanded state for further AJAX requests. It is designed this way to always honor the user preference ahead of the expand when. There may be use cases where in the user expands the layout manually and expects the layout to remain expanded irrespective of whether the when condition is true / false. Also we have to keep in mind that this is expand when condition and not collapse when condition
 
How expand when works ?
 
Expand when is controlled by a hidden input field with name ExpandedSubSectionXXYY (where XX - section name and YY - layout id)
 
On Initial load,
* If expand when wins - layout will be expanded and hidden input field will be set to true
* If expand when fails - design time setting will be honored and input field will be set to blank
 





































 
No Design Time Config Expand When Run time (on load) Hidden input
1 Collapsed True Expanded True
2 Collapsed False Collapsed  
3 Expanded True Expanded True
4 Expanded False Collapsed  

 
For conditions 1 & 3 -> Since the hidden input field is set to true, expand when condition will not be executed after initial load.
For Condition 2 & 4 -> If the user expands the layout manually, then hidden input field will be set to true and hence forth expand when condition will not be executed in server.
 
Possible Work Around:
 
Setting hidden input field parameter to,
 

  • False -> will collapse the layout

  • True -> will expand the layout

  • Blank("") -> will execute the evaluate when rule


  •  

In this case, since onclick of grid row, the grid should be collapsed, the parameter should be set to 'false'.
 

Published January 31, 2016 - Updated October 8, 2020

Was this useful?

0% 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