I have added an accordion to my reactive web page. Each AccordionItem has a save button.

When the user clicks the save button I'd like to automatically expand the next AccordionItem (if any) and possibly collapse the current item.

How can I do this - the accordionItems don't have an identifier from what I can tell.

1 In the list, create an isOpen attribute.


2 On the screen create your list where each item is an accordion.

3 Set the IsExpanded property for the isOpen attribute.


4 When saving an item use this assing.



Hope this helps.

Solution

Hi Mike,

You can have boolean variables like "accordion1IsOpen", and assign this variable in the accordion "IsExpanded" property. Every time you click save, change the value in that variable (like, if want to close Accordion1 and open Accordion2, change the value from "accordion1IsOpen" to false and the "accordion1IsOpen" to true).

If you have many accordions, you can put that values in a structure and work with that.


Hope this can help.


Best regards,

Ricardo

Solution

Ricardo Pereira wrote:

Hi Mike,

You can have boolean variables like "accordion1IsOpen", and assign this variable in the accordion "IsExpanded" property. Every time you click save, change the value in that variable (like, if want to close Accordion1 and open Accordion2, change the value from "accordion1IsOpen" to false and the "accordion1IsOpen" to true).

If you have many accordions, you can put that values in a structure and work with that.


Hope this can help.


Best regards,

Ricardo


Thanks, that works for the expand but for some reason it won't collapse when I set the value to false.

Mike de Mello wrote:

Ricardo Pereira wrote:

Hi Mike,

You can have boolean variables like "accordion1IsOpen", and assign this variable in the accordion "IsExpanded" property. Every time you click save, change the value in that variable (like, if want to close Accordion1 and open Accordion2, change the value from "accordion1IsOpen" to false and the "accordion1IsOpen" to true).

If you have many accordions, you can put that values in a structure and work with that.


Hope this can help.


Best regards,

Ricardo


Thanks, that works for the expand but for some reason it won't collapse when I set the value to false.


Can you share the code?


Thanks! ;)


Ricardo

Processing Upload...

Did you mean the .oml file? Or is there another way?

Here's a test oml file which shows the problem anyway.

Thanks

Mike

Mike de Mello wrote:

Did you mean the .oml file? Or is there another way?

Here's a test oml file which shows the problem anyway.

Thanks

Mike

I'm sorry, but this attachement appears like "Processing Upload" and don't let me download the OML file.


Ricardo Pereira wrote:

Mike de Mello wrote:

Did you mean the .oml file? Or is there another way?

Here's a test oml file which shows the problem anyway.

Thanks

Mike

I'm sorry, but this attachement appears like "Processing Upload" and don't let me download the OML file.


Sorry, I was away from the office, I'll try uploading as a zip file


Hi Mike,

See  the example that I send to you with the changes that you need to implement.


Best regards,

Ricardo

We are experiencing a similar behaviour where the accordion is expanding but not collapsing as expected.  The Collapse/Expand arrow changes the state (up or down) but the accordion content that should be collapsed is still visible.

Hi Luis,


See if the code in the OML that I attach in the previous comment can help you.


Best regards,

Ricardo

Thanks, so it seems the magic step is to replace the end with a destination of the current screen in the local action.