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

I am having problems receiving the information of the clicked item.
I registered each component ID with the variable ID (ID + 1),
example: I created a Cardview with the id 50, then I create a Label with the ID 51, which would be (ID + 1).
Now when I try to return the information of the clicked item, I take the ID of the Cardview component and add + 1, to call the component. check out the print:

I believed it would be all right, but I get this error:

Screenshot_1

The print shows that the error is in the called the Espace component.
When I call only Cardview and Horizontal Arrangement:

Everything works, but it should work for everyone, since the ID string is correct.

I don’t recommend this. Because ID’s can conflict when you do that. As ID supports strings you should give name like this:

1_Card
1_Label
1_Space

and make the number to 2 for the second card and its items so on.

So you won’t get this error.

2 Likes

Is Anyone Please Tell Me How To Add Space in This Extension? I Create Full Dynamic Card View With This Extension And its Work Fine But I m Not Able to Add Space Between Two Label.

use SpaceView

1 Like

Or use Decoration component to add Margin and Padding.

1 Like

delet
Hi
for those who like me can’t use this solution because your dynamic components have strings (EG : label_1, label_2…) here is the solution i use :

First, create empty list
kodular1

Then, each time you create a dynamic component, add it to the list :

When you need to reset remove all your components, you can use this code:
kodular3

And it works!

2 Likes

I Have total 5 Labels. So Please Tell Me How to Set ON CLICK function.
This is Blocks I Created.

1 Like

HI
first you have to set your dynamic clickable like this :

Then, just create an OnanylabelClick:

3 Likes

Hello. I’m new to dynamic components. May I ask if I use the remove Dynamic Card View, will it also delete all the things and IDs inside the Card View?

1 Like

Hello

No, you have to delete all Dynamic components one by one.

3 Likes

Thank you so much :blush:

2 Likes

i have a problem … when i click on a cardview the application opens a number of screens according to the number of items it has in the variable. how can i solve this?

My blocksIMG_20200523_020338

Set component name to SpaceView
image

Next time pls try


You can know the name by this way

For your case, it will return
Do It Result:
com.google.appinventor.components.runtime.MakeroidLinearProgressbar
So MakeroidLinearProgressbar is the component name

1 Like

Why you have the call dynamicComponent1 GetComponent ID in the if slot?
You should return a boolean to the if slot instead of ID.

1 Like

it was the only way I found to send the data to another screen

When send the screen receive ID of item list


When you are getting this error? I created linear progress bar successfully using these :point_down: blocks

blocks (54)

Also @WatermelonIce No need to use so much blocks :point_down: , just to know the name of a component

In the block editor, just drag and drop the last block of the component whose name you want to know and perform Do it on that. You will get something like this :point_down: containing the component name

prgress


@Thiago I don’t know what exact your requirements are. But I think, since you have the Open another screen block under the for loop, it’s obvious that it will open the screen, the number of times the for loop will be executed

3 Likes

I didn’t know that before :sweat_smile:

For your error, it seems that you type the whole com.google.appinventor.components.runtime.MakeroidLinearProgressbar
Only type MakeroidLinearProgressbar in the component part.

1 Like

here’s the solution to a 90% doubt of those using the extension … perform a action when clicking

A exemple

4 Likes