Need help with dynamic lists

Hi all !

I need help creating dynamic lists.

Currently, I manage to create items in my list and display them with the DynamicComponent extension.

But I can’t delete an item by pressing a button.

I am using the notifer to open a text entry popup, and when I validate, the text is added to the list. To this, I add a “trash” button which I normally use to delete the item. But this is where I block.

I searched for tutorials, but I cannot find the one that meets my expectations. What I want to do is:

  • Press an “Add” button
  • A popup opens to enter a text
  • The entered text is added to a list
  • Each element of the list must have a clickable button or icon to: edit, delete and possibly move the element to another position.

Could someone help me unblock myself from this situation please?

Here is my code:

Thank you for your help !

Better you can refer this.

I believe You can do it after reading this post.

To delete

1 Like

I will read all this, and if I succeed what I want, I will come back to solve your answer, otherwise I will ask for help again ^^

1 Like

With pleasure.

With the above suggestion you can add the items to the existing dyna list with that of same layout (buttons, space, label etc etc)

Okay, I’m coming back here because I can’t delete my item.

I followed the first link you gave me that helped me improve the way I added the elements, thanks.

On the other hand, to delete, I cannot. I have a list index error, I don’t understand.

I have a button that should be used to delete the entire element, another button that should be used to edit the text of the element. I am attaching the .ais of my screen, if you have any idea how I should do it that would be great! thank you

MolkkyScore_players_and_teams.ais (13.1 KB)

Importing screen , most of time, won’t work… anyway let me try

Ah sorry, I can import the entire project if you want, here it is:

MolkkyScore.aia (208.4 KB)

This is the screen “players and teams”

MolkkyScore1.aia (210.5 KB)

modified your procedure… Working fine. Tested in companion

Oh, forget the edit and it is now that too corrected…

Try this, both edit and delete works

MolkkyScore_2.aia (219.2 KB)

Thanks to both of you, it’s working fine. On the other hand, the version of Dora_Paz bug to edit the text:

I’m going to study your two versions and try to understand what you did, as they are two different approaches that do the same job.

I must now find how to move the elements to another position (put element 1 last, 2 in 4 etc …). And also having a “random” button at the bottom, next to “add”, to put the whole list in random order.

Thanks again !

1 Like

Where exactly bug occured ? Cause in companion seems works fine

The bug appeared when I tested in the companion. I added several texts to the list, and wanted to try the Edit button. The first text worked, but when I wanted to edit the second I got this error message

Could not replicate error

Did you test both tha aia separately ? Do not make any changes each one of aia with other methods. Because both views methods are different and will work well in aia as well as apk

1 Like

I do not understand, I wanted to redo to make a video capture but I no longer have the error. I don’t know what happened earlier.

I didn’t modify anything in the aia, just imported and tested. But a priori, it works, both, so the error message I got I don’t know why it appeared earlier. Surely he was badly awake! ^^

1 Like

Once again, thank you both. I will see which method I use, I still have to figure out what you did ^^

As both methods work, they are both the solution, so I’ll put the first one in solution, no jealousy eh! ^^

1 Like

Sorry, I had the same bug as this morning on the Gowri version. But actually it’s when I switch from one project to another, I have the bug at the start, and I refresh the screen and it works. I have to go too fast

1 Like

I suggest you after testing in apk only so i was shock to see the bug… and i am sure, it wont give you bug. :wink: :wink:

1 Like

@Still-learning I have a bug :sob:

Then try mine and see if it works :slight_smile: