Hi there,
I am wondering how to open and close Accordion Item programatically?
In a forum there is an answer, but i cannot find the property IsExpended.
https://www.outsystems.com/forums/discussion/74440/programatically-open-and-close-an-accordionitem/
regards and thanks
To open and close an Accordion Item programmatically, you can use the available client actions in OutSystems UI. These actions are specifically designed for managing the state of Accordion Items, and the IsExpanded property itself is not used for such programmatic manipulation.
IsExpanded
Instead of trying to modify the IsExpanded property, you can use the following client-side actions:
AccordionItemExpand
AccordionItemCollapse
AccordionItemExpandAll
AccordionItemCollapseAll
Here's how you can perform the operation:
AccordionItem
Name
AccordionItemName.Id
AccordionItem1
On Click
AccordionItem1.Id
From the description, you already have the "Content\AccordionItem" properties panel open. Make sure to fill in the Name property (e.g., AccordionItem1) so that the Accordion Item can be targeted programmatically.
This approach was confirmed in OutSystems UI documentation and forums. Specifically, when migrating to the OutSystems UI 2.14.0 or higher, it was clarified that the StartsExpanded property only works during initialization and cannot be used to toggle the state dynamically Accordion Item not expanding despite input parameter on True.
StartsExpanded
For more detailed instructions on using the Accordion pattern, refer to the official documentation Accordion.
It worked like a charm!
Hi @IQ78,
Have you tried using the 'AccordionItemExpand' and 'AccordionItemCollapse' client actions from outsystems UI?
The Accordion widget in Reactive behaves a bit differently as compared to one in Traditional web, specifically with the IsExpanded property. This property is not available by default in Reactive.
You can use a local boolean variable to control its visibility.