Question

Does the "Expand When" setting only get fired once?

I have a question about the "Expand When" container setting on dynamic layout panel.

I have a button that toggles the value of thisVariable true or false.

On a layout, I set the Header Type to be "Collapsabile" and, using the expression builder set the "Expand When" setting to "thisVariable = true".

When I first click the button and set thisVariable to true, the layout expands.

However, subsequently when I click the button nothing happens. When I manually collapse the layout, and then change the value of thisVariable to true again, nothing happens.

Question: Is this a defect or the correction functionality? Does the "Expand when" setting only get fired once? Why doesn't my layout expand everytime I set thisVariable to true?

**Moderation Team has archived post**

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

Correct Answer
March 28, 2017 - 5:05am

Hi,

"Expand when" configuration honors the state of layout at design time and executes the when rule only during initial load. But once the layout is expanded manually or through a server side when condition, it remains in an 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 the user expands the layout manually and expects the layout to remain expanded, irrespective of whether the when condition is true / false. Also developers need to keep in mind that this is an expand when condition and not collapse when condition.

Please have a look on the below article for more information :

https://pdn.pega.com/support-articles/expand-when-condition-grid-not-triggered-upon-refresh

Please let me know if it helps.

Comments

Keep up to date on this post and subscribe to comments

March 28, 2017 - 5:05am

Hi,

"Expand when" configuration honors the state of layout at design time and executes the when rule only during initial load. But once the layout is expanded manually or through a server side when condition, it remains in an 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 the user expands the layout manually and expects the layout to remain expanded, irrespective of whether the when condition is true / false. Also developers need to keep in mind that this is an expand when condition and not collapse when condition.

Please have a look on the below article for more information :

https://pdn.pega.com/support-articles/expand-when-condition-grid-not-triggered-upon-refresh

Please let me know if it helps.