Hi,

My Case Scenario

I need to add an Accordion Item depending on the number of Rows return from the query during preparation.

The number of Row Return is random. It can be 2, 3 or 4.

Much appreciated for your help 

Best Regards,

Harris

Hi Chew,

All you need to do is to use a List Records inside the Accordion, and an AccordionItem inside the List.
This way, one accordion item will be created for each row of the List (that the source would be the query you are doing in preparation.

Like the example attached.

Cheers.

Eduardo Jauch wrote:

Hi Chew,

All you need to do is to use a List Records inside the Accordion, and an AccordionItem inside the List.
This way, one accordion item will be created for each row of the List (that the source would be the query you are doing in preparation.

Like the example attached.

Cheers.

Hi Eduardo,

Thank you for your help. This has helped me. 

Building on top of that example, I have an another case scenario where the users is able to click on a Button "Add" to Add a new AccordionItem to the list manually. The AccordionItem will allow me to input the data required (Just 2 input fields) . When I Click on the button save, this AccordionItem will be submited to the database and the data source is refresh, widget is refresh to display this new AccordionItem.

Hope I am clear in explanation. Thank you :) 


Hello Chew, 

The explanation was perfect. 

But I don't understand if you are saying what you've done, or if you have a problem :) 

Cheera

Eduardo Jauch wrote:

Hello Chew, 

The explanation was perfect. 

But I don't understand if you are saying what you've done, or if you have a problem :) 

Cheera

Hi Eduardo,

Thank you for reply.  I am having a problem with that. Much help will be appreciated :)

Best Regards,

Harris Chew

Hi, 

And what is the problem? 

Cheers. 

Hi Eduardo,

1) How do i Add an Accordion item when a user clicks on "Add Accordion" Button

2) When the New Accordion Item is created , the user can enter data into input fields. Then click an" Add new Record Button"

3) Once that button is clicked, refresh data source , ajax refresh and this new record is displayed.

So I am not sure how do pull this off technically, thats my problem :)

Best Regards,

Harris Chew

Hello Chew, 

1. You need to have a List Records inside the accordeon to have dynamic number of accordeon items (inside the list). So, to add an accordeon item, you need to add an item (row/record) to the source list of the List Records and refresh it, or directly to the list of the List Records with ListAppend (in an action called with Ajax submit ).

2. The inputs should be bound to attributes in the List Records List Current. So they will be available when the user press the button to save them. 

3. If you do the above, you only need to save the data to entity. Most likely you will not need to refresh the list. Unless you are showing data in a different list or need to update other attributes. 

For sure there are other ways of doing this, but this is very straight forward. You show itens of a list, if you want to add more items, add them to the list. 

Don't get me wrong, these concepts are covered in the online training that should have enabled you to imement it without having to ask, and while asking this is not a problem (keep asking!) , you need to ask yourself if you need a refresh in your understanding of OutSystems concepts, like how the widgets/lists/Ajax work, or if you need to improve your basic programing skills (I am always revisiting the basics myself). 

Yes, I am the annoying guy asking everybody to go back to study, but I can't avoid, I am a trainer ;) 

If you need more details, feel free to ask. 

Cheers. 

Eduardo Jauch wrote:

Hello Chew, 

1. You need to have a List Records inside the accordeon to have dynamic number of accordeon items (inside the list). So, to add an accordeon item, you need to add an item (row/record) to the source list of the List Records and refresh it, or directly to the list of the List Records with ListAppend (in an action called with Ajax submit ).

2. The inputs should be bound to attributes in the List Records List Current. So they will be available when the user press the button to save them. 

3. If you do the above, you only need to save the data to entity. Most likely you will not need to refresh the list. Unless you are showing data in a different list or need to update other attributes. 

For sure there are other ways of doing this, but this is very straight forward. You show itens of a list, if you want to add more items, add them to the list. 

Don't get me wrong, these concepts are covered in the online training that should have enabled you to imement it without having to ask, and while asking this is not a problem (keep asking!) , you need to ask yourself if you need a refresh in your understanding of OutSystems concepts, like how the widgets/lists/Ajax work, or if you need to improve your basic programing skills (I am always revisiting the basics myself). 

Yes, I am the annoying guy asking everybody to go back to study, but I can't avoid, I am a trainer ;) 

If you need more details, feel free to ask. 

Cheers. 

Hi Eduardo, 

Thanks so much for the clarification! Yes i will definitely head back to refresh my basic understanding :)

Just another problem i have encountered, I am unable to launch my application. Please see the attach image.

Best Regards,

Harris

Hi, 

Maybe this thread can help, particularly the last comment: https://www.outsystems.com/forums/discussion/39639/exception-from-hresult-0x80040154-regdb-e-classnotreg-sanitization/

Let me know if it works. 

Cheers

Eduardo Jauch wrote:

Hi, 

Maybe this thread can help, particularly the last comment: https://www.outsystems.com/forums/discussion/39639/exception-from-hresult-0x80040154-regdb-e-classnotreg-sanitization/

Let me know if it works. 

Cheers

Hi Eduardo, 

It can't seem to work.

Just want to ask another simple question. My Rich Widget Calendar function gets cut off when I am trying to add a new record through a POP UP. Could you please advice on how to solve this? I have attached an image.

Best Regards,

Harris Chew

Hi Chew

Regarding the dynamic accordeon, could you provide a sample module (without dependences), implementing the dynamic accordeon the way you are doing, so I can take a look to see if there is something missing or misplaced? 

About the pop-up thing. 

As it is a question not related to the original post, could you open a new topic for it? 

Cheers