Application crashes after adding item id to the dictionary

In the forum it is recommended to use AnyComponents lists and blocks to not duplicate the same blocks. I needed a relationship between two elements. I came up with the idea to use a dictionary. I added the id of the buttons to the keys and added the arrangement id to the value. After pressing the button I wanted to change the color of the arrangement in the loop. But this is not important.

I noticed a problem. After adding button identifiers and arrangement to the dictionary, I compiled the application. Unfortunately, the application is damaged. Why can I add item ids to lists but not to the dictionary?

Could you show an example of the blocks you are using to populate the dictionary and make use of it?

You don’t have to use the dictionary. Just insert such blocks:

  • keys are buttons
  • value are arrangements

The application works without these blocks, but not with those blocks… It looks like everything presses itself in the application.

That should certainly work. I’ll have to run some tests to understand what’s going on.

I did the test. An application with four buttons that does nothing. The blocks are empty.

The app looks ok:

Now I have added dictionary blocks to the application:

The application looks like this:

As you can see, creating a dictionary with interface elements completely corrupts even the simplest application.

What happens if you set global zakladi_zdarden to a dictionary in Screen1.Initialise, instead of direct setting it?

Just tested, same output as PatrykF in compiled app when loading like this

I’ve identified the issue in the code and will work on a fix.

Edit: Fix is up on GitHub, pending review: