[Free] CompCreator - create component dynamically

As I thought. Thank you. And I guess the same apllies to @yusufcihan 's DC.

1 Like

Creating extension components dynamically should work as expected, it just doesn't work with by simply entering its name, like "Button", but passing an existing component's block is supported regardless of if it is a native component or not.

2 Likes

Brilliant. I could create it. I tried it before but i tried to create on Screen1 and that did not work. I had to create on an arrangement.
I still have a problem. When I create one at screen init that works. If i delete it and recreate in runtime it does not work. I still did not have time to debug why.

If the above is not about CompCreator, please start a new topic

:+1:
Only answered him.

v8.6 update:

  1. ListComponents function added. this can return a list of same type (like buttonts, labels) in one container.
  2. other small bugs.

Difference between this ListComponents and native every Component:

  1. List Components return a list of some container, direct children or not. Every component only can return all the same type component on the screen.
  2. ListComponents will return a list with certain order, but Every component not.
  3. Every component do not support dynamicly created one.
1 Like

Could we have some example blocks for the list components function ?

To get all checkbox in the VSA, even if the checkbox is not the son of VSA, but grand grand son

compcreator-listview.aia (60.8 KB)

1 Like

First, thanks for your efforts on this amazing extension!

Now, am I doing something wrong or is this a bug? I am trying to set a textbox to be numbers only. Below is the block I am using to create the textbox. When the box is created, it does allow any character to be added and doesn't force numbers only.

Not doing some thing wrong.

replace with a text block that says "NumbersOnly"

@Kevinkun note this for next release :wink:

2 Likes

Thanks!

3 posts were split to a new topic: Yusifchan Dynamic Components Extension: Attempt to invoke virtual method 'int org.json.JSONArray.length()' on a null object reference

this works with any android version?. the compcreator?

I have used it on Android 7 to 13 without a problem. If you have earlier/later devices, I suggest you test the extension on those devices and report back.

It would be much better if you did this in advance of asking a question so you could then ask:

I tried this extension on Android "X" and it didn't work for me, here are my blocks:

1 Like

how can create a class of imagesprite to generate a number of clones imagesprites. its a little complex understand the extension. sorry for my poor experience understand this comp creator.

my objective its not add a lot of imagesprites in design window.

I suggest you read the entire topic from the beginning, to gain an understanding of how it works, and try some of the examples.

Hi.... I read the article like five times and I am still really confused... Is it possible to somehow check that button created dynamically was clicked and then for example get the name of the button? Thanks in advance

Show your relevant blocks.

When a component is created dynamically, you need to capture the component name/value in a variable/list, then you can access it later.

1 Like

Oh thanks.... I will try this

By far I've done this:

now I basically need to get the index (in the list) of a button if the user clicked on it... the problem is I have no idea how to do this...
If you could help me, I'd be grateful
Thanks in advance