456
Views
12
Comments
Solved
Accordion expand on save

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.

2021-03-05 13-56-11
Ricardo Pereira
 
MVP
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

UserImage.jpg
Mike de Mello

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.

2021-03-05 13-56-11
Ricardo Pereira
 
MVP

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

2020-10-12 05-46-33
Nikhil Gondane

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

Hi Ricardo, Sorry for disturbing this link ,

But I have one query could you possible this scenario in dynamic accordion list.....

If any suggestion  please help me .

Thanks in adv.

Nikhil


2019-11-19 18-04-26
Fabricio Aguiar

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.

2021-03-05 13-56-11
Ricardo Pereira
 
MVP
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

UserImage.jpg
Mike de Mello

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.

2021-03-05 13-56-11
Ricardo Pereira
 
MVP

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

2020-10-12 05-46-33
Nikhil Gondane

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

Hi Ricardo, Sorry for disturbing this link ,

But I have one query could you possible this scenario in dynamic accordion list.....

If any suggestion  please help me .

Thanks in adv.

Nikhil


UserImage.jpg
Mike de Mello

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

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

Thanks

Mike

AccordionProblem.oml
2021-03-05 13-56-11
Ricardo Pereira
 
MVP

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.


UserImage.jpg
Mike de Mello

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


AccordionProblem.zip
2021-03-05 13-56-11
Ricardo Pereira
 
MVP

Hi Mike,

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


Best regards,

Ricardo

AccordionTest.oml
UserImage.jpg
Luis Montalvo

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.

2021-03-05 13-56-11
Ricardo Pereira
 
MVP

Hi Luis,


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


Best regards,

Ricardo

UserImage.jpg
Mike de Mello

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

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.