[Silk UI Web] Section Expandable - Expand on action

Forge Component
Published on 25 Mar by OutSystems R&D
85 votes
Published on 25 Mar by OutSystems R&D
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.
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
Ah thats perfect! Thanks a lot for you help!

Hi Samuel,

For server side validation it is working fine for me but for client side validation if any any error occur then how can expand the accordian ?

Thanks & Regards

DM Singh