Dynamically selecting buttons

Hi, I am working on an app that presents the user with a section of five Museums four Restaurants and eight Cultural Centers. I am trying to use only one arrangement and add content dynamically to show the section the user wants but since each section has different amount of elements I cannot find a way to dynamically show just the elements the user is interested on, that is if the user chooses "Museums" there are only five items, if the user chooses "Restaurants" there are four items and if the user chooses Cultural Centers there are eight items to show. I understand that if I want to use one Arrangement to show all these items I should have the maximum number of items ( 8 ) those being images or labels, etc. in the arrangement and just turn off or deactivate the ones I won't be needing. I've experimenting but I can't find a solution. I would greatly appreciate any suggestions on how to accomplish this behavior.

I would think the best way would be to create a Vertical or Horizontal Arrangement for each category, then Hide or Show the arrangement based on the user selection.

That would be easier than trying to hide/show several labels or images. Is there any reason that you want to use only 1 arrangement?

What do you have so far? Could you post your blocks?

Mike

Do you use dynamic components extension by @yusufcihan ?

Try this and see if it works for you

DYNAMIC_1.aia (37.8 KB)

Hello Mike, thanks for your prompt response, I think your approach will work just fine. I wanted to use 1 arrangement just to keep my code to a minimum and avoid issues when compiling but it was turning very complex for me to sort the problem out.

I will use your solution as suggested in the mean time here are my blocks

Hello dora_paz, I've already downloaded the project you sent, I will look into it. Thank you very much :slight_smile:

1 Like

If you want to avoid extensions and keep data out of your blocks, see these samples ...

Sliding a list of fixed components against an indefinitely long data list:

Navigate through a tree of html pages based on a table of headers and links: