[Silk UI Web] Section Expandable - Expand on action

[Silk UI Web] Section Expandable - Expand on action

  
Forge Component
(47)
Published on 11 Nov (3 weeks ago) by OutSystems Labs
47 votes
Published on 11 Nov (3 weeks ago) by OutSystems Labs
Hi
Is there a way to expand a section from an action (variable change etc)?  Essentially I have a series of sections and a save button.  On save i want to run validation and expand the first section that has any errors.  At the moment it collapses all by default.
Hello Daniel,

Looking at your description, I believe that you may be using the Accordion pattern.
SilkUI has a pattern called Section Expandable, where you can define with a variable if its open or closed. With that in mind, you may set the variable on your validation action to expande or collapse each different section as you may need.

Best Regards,
Samuel Jesus
We are using the Section Expandable pattern and the "Is Expanded" property only accepts a true/false value.  I cant set a boolean variable for it to expand when I see an validation error.
Solution
Hello Daniel,

Actually, you can create a Boolean Variable and use it on the IsExpanded property.
On this example, I created a new boolean variable on my page and used it on my Section Expandable:





Then on the button action I validated my information, and If an error was found, I changed the value of the variable:




The result was that if an error is found, the only expanded section is the one with the error:




Best regards,
Samuel Jesus
Solution
Ah thats perfect! Thanks a lot for you help!