[F/OS] - Dynamic Components Extension (for every component) 2.3.0

Get clicked buttons’ id with GetId block and use it in if block. (Example, if id equals 1, show a toast, else if id equals 2, change the button text.)

2 Likes

ok thanks I had not noticed the getID, everything worked well

2 Likes

Another benefit of string ID is the ability to store lists in it and reference when needed. It will be easier to identify a card and there is no limit to how many components it can make before overlapping IDs

1 Like

Actually you can already store integer IDs in a list. String ID will only allow adding characters inside to the ID along with numbers. Nothing more.

ID is ID, even a number or string, both of them is unique, never overlaps. And always unique.

4 Likes

Oh nice! That way it will be easier

1 Like

So, how far down the rabbit hole of dynamic components is too far? I have played around with creating almost the entire screen that way. Is there a point that it becomes overboard?

An example would be a form that has questions separated into sections. I created a list (each section) of lists (each question) and used dynamic components to create the entire form including headers, questions, radio buttons, and text boxes. (I’ve been messing around with Dart/Flutter as well and everything is created in a widget tree there, helped me visualize how to do something similar here in Kodular). As the extension developer, where would you say the line should be drawn?

I also ran into an issue trying to make text bold on my headers. I thought adding HTML tags for bold text would work, but it just added the tags as text to the header instead.

1 Like

I don’t think so, if I understood correctly. :sweat_smile:

You need to enable HTML property too to use HTML tags.

For example, in a quiz app, it is better to use static components because all questions have 4 answers (which is never changes), so it is not needed to creating answers dynamically. Just put 4 constant button and change their texts. I don’t suggest creating dynamic component for these type of situations.

Dynamic things are used in situations which you don’t know the count. For example you can’t learn how much record will be pulled from a table without getting data. But in a quiz app, we already have an information which how many answers will be added.

So using static components is better if you know the count.

4 Likes

The biggest issue is there have been quite a few changes to the forms I use since the first time around and I was thinking (to eventually make things easier for myself) storing the questions on Firebase as a list and grabbing each list and then populating the form. that way if the manager wants to change things it doesn’t require an update to the play store.

2 Likes

Yeah, looks like this is a good way to use dynamic components!

4 Likes

Or you have a lot of repetitive components to create. I’m using it with +230 sprites right now. It’s a walk in the park! :smiley:

5 Likes


Nope, i cant add lists to number fields

2 Likes

What is the purpose of adding list to id section? If it was a String id, you wouldn’t able to add lists too. Lists has own type. They are not string.

2 Likes

It is so that i can refer to the correct JSON list when a card is clicked. Like how the daily section has its own JSON list and top shows has one JSON list too.

If i cannot identify the card properly, I will have a incorrect result

2 Likes

You should use join block from Text category if you want to join two text pieces, because list block doesn’t join two items.

3 Likes

I think you have a little confusion there. I don’t see a benefit of using a list in the component ID.
If you want to access every component, then you create a list of ID’s and iterate thru it by using a FOR EACH item IN LIST block.

Or if your confusion is about “building” the id with different pieces or strings, then what @yusufcihan said about using JOIN is what you need.

Put ID in a list, not a list in ID. :grin:

4 Likes

Faced Error during the horizontal arrangement.

1 Like

You are using Kodular’s built-in dynamic components, you should migrate to the my extension for creating all dynamic components. Otherwise extension won’t work for you.

As Kodular’s dynamic components returns a reference to the component instead of just returning itself, you can’t use Kodular’s dynamic components with my extension. This is not my fault. :upside_down_face:

3 Likes

Can you please tell me cardview name

1 Like

“MakeroidCardView” is the internal name of CardView as I said in earlier posts.

2 Likes

Thanks :blush: :blush:
Also, what’s the internal name of the space component?

2 Likes