Button visibili e invisibili

Hello everyone,
basically I have 90 buttons. Then by pressing button 1, all related subfolders are displayed. Obviously, by pressing button 2, the subfolders of both buttons are displayed. How do I get only the subfolders of the active button to be displayed?
Greetings
Nicola

Hello Nicola

I'd have used an HTML page for this, 90 'buttons' in a table.

Have a simple Procedure that firstly un-displays all sub-folders, then displays the required sub-folder.

At this level, you would be better off using Generic (Any Button) Click events, and table lookup of folder(s) based on either the button component or the button .Text (if unique).

The .Text based lookup is easier, as you could load the table mapping button text into folder name(s) from a CSV table file in the Media folder at app startup.

When I press button 1, buttons 2 and 3 do not appear.
When I press button 2, buttons 1 and 3 are not displayed.
When I press button 3, buttons 1 and 2 are not displayed.
And this formula applies for all 90 buttons

This all just looks so wrong !

You could use two listviews for this.

Can we see your Blocks re displaying a sub-folder? Your video just seems to display more buttons.

if button 2 and 3 are non visible ,how do you press it?

This is starting to look like a nested List Picker project, infected with Buttonitis.

2 Likes

Simply, on 90 buttons; if I press button 1, I only see its subfolders .. while the subfolders of the 89 buttons remain invisible.

then what's this? a group of buttons related to this button?

save the sub group buttons in lists or dictionary ,
when any button.clicked, show or hide relevant group list

For every main buttons create a global list and add the subgroup buttons . And in when any button clicked event easily you can handle which group of buttons need to visible and invisible easily or switch over the buttons too easily

Or for every main buttons create VA or HA in which you add the related group buttons and try to hide the arrangements accordingly to the button click

VID_20221104151743

EDIT: Instead of using generic buttons, it will be good to use buttons created dynamically so that app also won't freeze and won't throw any error on compiling

I too had thought about putting all the subfolders inside an HA; but when the HA starts to become many… it becomes difficult to manage them. In your video; what method did you use?

First I created a HA in which I added VA(primary) for every main buttons and under every button I have added another VA(secondary) for sub groups and added group buttons then unhide those secondary VA

Now I put the main buttons into the list and the secondary VA into another list. So that upon clicking the main button I get the index number , by using this number I showed the relevent secondary VA visible to true and other VA to false

Simple


Buttons.aia (2.6 KB)

EDIT : Check it

Display all 90 buttons - when one is picked, hide all 90 sub-folders, then show the related sub-folder (which you have not shown thus far, only more buttons).

Rethink your design... to have a lot of the same components hard coded is the wrong approach...

It looks like a listpicker or listview would make more sense....

How to create a nested listpicker

Also you might want to explain more in detail, what exactly is a subfolder to get better advice...

Taifun

1 Like

Instead of 90 buttons, this can be done with two ListViews, stacked vertically.

The top Listview contains the current PATH, one Element per step.
The bottom Listview lists the files/directories in the current directory.

@TaifunI had forced myself to use primary and secondary HA; but honestly I hadn't really thought about simply using nested ListPickers. :upside_down_face:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.